<commit_before>
def MOS_ASYMPTOTE(states, LB="17.2450", VB="13.0207", title="Title", draw_band=False, draw_occupation=False, draw_energy=False):
    """

    :states: TODO
    :returns: TODO

    """
    energies    = "{"
    spins       = "{"
    occupations = "{"
    bands       = "{"

    STATES_STRING=""
    for state in states:
        energy     = str(state["energy"])
        spin       = str(state["spin"])
        occupation = str(state["occupation"])
        band       = str(state["number"])
        STATES_STRING+="""\
//energy, spin, occupation, band
state(%s, %s, %s, %s)
.setAutoPosition()
.draw( draw_band       = DRAW_BAND,
    draw_occupation = DRAW_OCCUPATION,
    draw_energy     = DRAW_ENERGY
);\n\n"""%(energy, spin, occupation, band)
    return """

string LUMO_TITLE="%s";

real ENERGIE_LB_PRISTINE   = %s ;
real ENERGIE_VB_PRISTINE   = %s ;

real OBERKANTE     = 100;
real UNTERKANTE    = 0;
real IMG_WIDTH     = 50;
real KANTEN_HEIGHT = 20;

bool DRAW_ENERGY     = %s;
bool DRAW_BAND       = %s;
bool DRAW_OCCUPATION = %s;

unitsize(.2cm);

struct state {
  static int state_count;
  real energy;
  real occupation;
  real band;
  real value;
  string title           = "";
  real spin              = 0;
  real VB                = ENERGIE_VB_PRISTINE;
  real LB                = ENERGIE_LB_PRISTINE;
  real DASH_WIDTH        = 25;
  real DASH_HEIGHT       = 1.8;
  real X_COORD           = 0;
  real Y_OFFSET          = 0;
  real OCCUPATION_CUTOFF = 0.1;
  real getPlottingValue (){
    real val = 100*(energy - VB)/(LB-VB);
    return val + Y_OFFSET;
  };
  void operator init(real energy, real spin, real occupation, real band){
    this.energy     = energy;
    this.occupation = occupation;
    this.band       = band;
    this.spin       = spin;
    this.value      = getPlottingValue();
    state_count    += 1;
  };
  bool isOccupied(){
    if ( occupation >= OCCUPATION_CUTOFF ) {
      return true;
    } else {
      return false;
    }
  };
  pair getMiddlePoint (  ){
    real x,y;
    x = X_COORD+(DASH_WIDTH)/2;
    y = value + (DASH_HEIGHT)/2;
    return (x,y);
  };
  state setAutoPosition (){
    int controller = state_count%%2;
    X_COORD=0+controller*(DASH_WIDTH);
    return this;
  };
  bool  isLeft (){
    if ( getMiddlePoint().x >= IMG_WIDTH/2 ) {
      return false;
    }
    else{
      return true;
    }
  };
  bool isUp (){   return spin == 1?true:false; };
  bool isDown (){ return spin == 2?true:false; };
  pair getSpinPosition (bool up=false){
    real x_deviation = 0.25*DASH_WIDTH;
    pair middle      = getMiddlePoint();
    if (up) {
      return (middle - (-x_deviation,0));
    } else {
      return (middle + (-x_deviation,0));
    }
  };
  path getSpinArrow (){
    bool up = isUp();
    pair position = getSpinPosition(up);
    real height = 3*DASH_HEIGHT;
    if (isUp()) {
      return position - (0,height/2) -- position + (0,height/2);
    } else {
      return position + (0,height/2) -- position - (0,height/2);
    }
  };
  state draw_energy (){
    if ( isLeft() ) {
      label((string)energy, (X_COORD,value), W, red);
    } else {
      label((string)energy, (X_COORD+DASH_WIDTH, value), E, red);
    }
    return this;
  };
  state draw_spin(){
    pen style;
    real height          = 2*DASH_HEIGHT;
    pen unoccupied_style = 0.7*white+dashed;
    pen occupied_style   = black;
    if ( isOccupied() ) {
      style = occupied_style;
    } else {
      style = unoccupied_style;
    }
    path spinArrow = getSpinArrow();
    draw(spinArrow, linewidth(3)+style,Arrow(15));
    return this;
  };
  state draw (
      bool draw_band       = false,
      bool draw_occupation = true,
      bool draw_energy     = true
      ){
    pen style = red;
    real OCCUPATION_CUTOFF=0.1;
    if (occupation<=OCCUPATION_CUTOFF){
      style=gray;
    }
    filldraw(
        box(
          (X_COORD,value)
          ,(X_COORD+DASH_WIDTH,value+DASH_HEIGHT)
          ),
        style,style*0
        );
    if ( draw_band )
      label(scale(1)*(string)band       , getMiddlePoint() - (DASH_WIDTH/4 , 0) , black);
    if ( draw_occupation && occupation != 0)
      label(scale(1)*(string)occupation , getSpinPosition(!isUp()) , black);
    if ( draw_energy ) draw_energy();
    if ( spin != 0 ) draw_spin();
    return this;
  };
};



//----------------------------<commit_msg>colors<commit_after>
def MOS_ASYMPTOTE(states, LB="17.2450", VB="13.0207", title="Title", draw_band=False, draw_occupation=False, draw_energy=False):
    """

    :states: TODO
    :returns: TODO

    """
    energies    = "{"
    spins       = "{"
    occupations = "{"
    bands       = "{"

    STATES_STRING=""
    for state in states:
        energy     = str(state["energy"])
        spin       = str(state["spin"])
        occupation = str(state["occupation"])
        band       = str(state["number"])
        STATES_STRING+="""\
//energy, spin, occupation, band
state(%s, %s, %s, %s)
.setAutoPosition()
.draw( draw_band       = DRAW_BAND,
    draw_occupation = DRAW_OCCUPATION,
    draw_energy     = DRAW_ENERGY
);\n\n"""%(energy, spin, occupation, band)
    return """

string LUMO_TITLE="%s";

real ENERGIE_LB_PRISTINE   = %s ;
real ENERGIE_VB_PRISTINE   = %s ;

real OBERKANTE     = 100;
real UNTERKANTE    = 0;
real IMG_WIDTH     = 50;
real KANTEN_HEIGHT = 20;

bool DRAW_ENERGY     = %s;
bool DRAW_BAND       = %s;
bool DRAW_OCCUPATION = %s;

unitsize(.2cm);

struct state {
  static int state_count;
  real energy;
  real occupation;
  real band;
  real value;
  pen color;
  pen spin_color;
  string title           = "";
  real spin              = 0;
  real VB                = ENERGIE_VB_PRISTINE;
  real LB                = ENERGIE_LB_PRISTINE;
  real DASH_WIDTH        = 25;
  real DASH_HEIGHT       = 1.8;
  real X_COORD           = 0;
  real Y_OFFSET          = 0;
  real OCCUPATION_CUTOFF = 0.1;
  real getPlottingValue (){
    real val = 100*(energy - VB)/(LB-VB);
    return val + Y_OFFSET;
  };
  bool isOccupied(){
    if ( occupation >= OCCUPATION_CUTOFF ) {
      return true;
    } else {
      return false;
    }
  };
  state setStyle(){
    if ( isOccupied() ) {
      color = red;
    } else {
      color = gray;
    }
    pen unoccupied_style = 0.7*white+dashed;
    pen occupied_style   = black;
    if ( isOccupied() ) {
      spin_color = occupied_style+linewidth(3);
    } else {
      spin_color = unoccupied_style+linewidth(3);
    }
    return this;
  };
  void operator init(real energy, real spin, real occupation, real band){
    this.energy     = energy;
    this.occupation = occupation;
    this.band       = band;
    this.spin       = spin;
    this.value      = getPlottingValue();
    state_count    += 1;
    setStyle();
  };
  pair getMiddlePoint (  ){
    real x,y;
    x = X_COORD+(DASH_WIDTH)/2;
    y = value + (DASH_HEIGHT)/2;
    return (x,y);
  };
  state setAutoPosition (){
    int controller = state_count%%2;
    X_COORD=0+controller*(DASH_WIDTH);
    return this;
  };
  bool  isLeft (){
    if ( getMiddlePoint().x >= IMG_WIDTH/2 ) {
      return false;
    }
    else{
      return true;
    }
  };
  bool isUp (){   return spin == 1?true:false; };
  bool isDown (){ return spin == 2?true:false; };
  pair getSpinPosition (bool up=false){
    real x_deviation = 0.25*DASH_WIDTH;
    pair middle      = getMiddlePoint();
    if (up) {
      return (middle - (-x_deviation,0));
    } else {
      return (middle + (-x_deviation,0));
    }
  };
  path getSpinArrow (){
    bool up = isUp();
    pair position = getSpinPosition(up);
    real height = 3*DASH_HEIGHT;
    if (isUp()) {
      return position - (0,height/2) -- position + (0,height/2);
    } else {
      return position + (0,height/2) -- position - (0,height/2);
    }
  };
  state draw_energy (){
    if ( isLeft() ) {
      label((string)energy, (X_COORD,value), W, red);
    } else {
      label((string)energy, (X_COORD+DASH_WIDTH, value), E, red);
    }
    return this;
  };
  state draw_spin(){
    path spinArrow = getSpinArrow();
    draw(spinArrow, spin_color,Arrow(15));
    return this;
  };
  state draw (
      bool draw_band       = false,
      bool draw_occupation = true,
      bool draw_energy     = true
      ){
    filldraw(
        box(
          (X_COORD,value)
          ,(X_COORD+DASH_WIDTH,value+DASH_HEIGHT)
          ),
        color,color*0
        );
    if ( draw_band )
      label(scale(1)*(string)band       , getMiddlePoint() - (DASH_WIDTH/4 , 0) , black);
    if ( draw_occupation && occupation != 0)
      label(scale(1)*(string)occupation , getSpinPosition(!isUp()) , black);
    if ( draw_energy ) draw_energy();
    if ( spin != 0 ) draw_spin();
    return this;
  };
};



//----------------------------
{'fraction_non_alphanumeric': 0.14287351054078826, 'fraction_numerical': 0.015811182401466544, 'mean_word_length': 2.2257945306725793, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2164492', 'n_tokens_mistral': 3234, 'n_tokens_neox': 3080, 'n_words': 671}