Allowed office types:
            capitol
            district
436989
def add_office(self, type, name, address=None, phone=None, fax=None,
                   email=None, **kwargs):
        
        office_dict = dict(type=type, address=address, name=name, phone=phone,
                           fax=fax, email=email, **kwargs)
        self['offices'].append(office_dict)
217149
private function addACLEntry($role, $resourceType, $folderPath, $allowRulesMask, $denyRulesMask)
    {

        if (!strlen($folderPath)) {
            $folderPath = '/';
        }
        else {
            if (substr($folderPath,0,1) != '/') {
                $folderPath = '/' . $folderPath;
            }

            if (substr($folderPath,-1,1) != '/') {
                $folderPath .= '/';
            }
        }

        $_entryKey = $role . "#@#" . $resourceType;

        if (array_key_exists($folderPath,$this->_aclEntries)) {
            if (array_key_exists($_entryKey, $this->_aclEntries[$folderPath])) {
                $_rulesMasks = $this->_aclEntries[$folderPath][$_entryKey];
                foreach ($_rulesMasks[0] as $key => $value) {
                    $allowRulesMask[$key] |= $value;
                }
                foreach ($_rulesMasks[1] as $key => $value) {
                    $denyRulesMask[$key] |= $value;
                }
            }
        }
        else {
            $this->_aclEntries[$folderPath] = array();
        }

        $this->_aclEntries[$folderPath][$_entryKey] = array($allowRulesMask, $denyRulesMask);
    }
901236
function addressList() {
        return wrap('address-list', or(
            and(
                address,
                star(and(literal(','), address))
            ),
            obsAddrList
        )());
    }
557973
def route_election(self, election):
        
        if (
            election.election_type.slug == ElectionType.GENERAL
            or ElectionType.GENERAL_RUNOFF
        ):
            self.bootstrap_general_election(election)
        elif election.race.special:
            self.bootstrap_special_election(election)

        if election.race.office.is_executive:
            self.bootstrap_executive_office(election)
        else:
            self.bootstrap_legislative_office(election)
269097
def print_mso_auto_shape_type_spec():
    """"""
    auto_shape_types = MsoAutoShapeTypeCollection.load(sort='const_name')
    out = render_mso_auto_shape_type_spec(auto_shape_types)
    print out
63833
def cli(env, limit, closed=False, get_all=False):
    """"""

    manager = AccountManager(env.client)
    invoices = manager.get_invoices(limit, closed, get_all)

    table = formatting.Table([
        "Id", "Created", "Type", "Status", "Starting Balance", "Ending Balance", "Invoice Amount", "Items"
    ])
    table.align['Starting Balance'] = 'l'
    table.align['Ending Balance'] = 'l'
    table.align['Invoice Amount'] = 'l'
    table.align['Items'] = 'l'
    if isinstance(invoices, dict):
        invoices = [invoices]
    for invoice in invoices:
        table.add_row([
            invoice.get('id'),
            utils.clean_time(invoice.get('createDate'), out_format="%Y-%m-%d"),
            invoice.get('typeCode'),
            invoice.get('statusCode'),
            invoice.get('startingBalance'),
            invoice.get('endingBalance'),
            invoice.get('invoiceTotalAmount'),
            invoice.get('itemCount')
        ])
    env.fout(table)
234572
function(r) {
      var llc = this.lowerLeftCoor(r),
          lrc = this.lowerRightCoor(r, llc);

      return [
        {x: r.x1, y: r.y1},
        {x: r.x2, y: r.y2},
        {x: llc.x, y: llc.y},
        {x: lrc.x, y: lrc.y}
      ];
    }
477967
function getRequiredRoleList (resourceType, resourceName, action, rbacIndex) {
  // What roles will allow this?
  const unrestricted = dottie.get(rbacIndex, '*.*.*') || []
  const unrestrictedInADomain = dottie.get(rbacIndex, `${resourceType}.*.*`) || []
  const anyActionOnASpecificResource = dottie.get(rbacIndex, `${resourceType}.${resourceName}.*`) || []
  const anyDomainResourceForASpecificAction = dottie.get(rbacIndex, `${resourceType}.*.${action}`) || []
  const specific = dottie.get(rbacIndex, `${resourceType}.${resourceName}.${action}`) || []

  return unrestricted.concat(
    unrestrictedInADomain,
    anyActionOnASpecificResource,
    anyDomainResourceForASpecificAction,
    specific
  )
}
861783
def get_executive_offices(self, obj):
        """"""
        return reverse(
            'electionnight_api_office-election-list',
            request=self.context['request'],
            kwargs={'date': obj.date}
        )
154358
def find_reasonable_designs(workspaces, condition=None, verbose=False):
    
    print "Loading designs..."

    designs = []

    if condition is None:
        condition = 'restraint_dist < 1.2'

    for workspace in workspaces:
        for directory in workspace.output_subdirs:
            if verbose:
                print '  ' + directory

            design = structures.Design(directory)
            vars = design.structures.iloc[design.rep].to_dict()
            if pd.eval(condition, local_dict=vars):
                designs.append(design)

    return designs
535314
def groups_set_type(self, room_id, a_type, **kwargs):
        """"""
        return self.__call_api_post('groups.setType', roomId=room_id, type=a_type, kwargs=kwargs)
561228
def bootstrap_executive_office_states(self, election):
        
        content_type = ContentType.objects.get_for_model(election.race.office)
        for division in Division.objects.filter(level=self.STATE_LEVEL):
            PageContent.objects.get_or_create(
                content_type=content_type,
                object_id=election.race.office.pk,
                election_day=election.election_day,
                division=division
            )
        # Create national presidential page type
        page_type, created = PageType.objects.get_or_create(
            model_type=ContentType.objects.get(
                app_label='government',
                model='office'
            ),
            election_day=election.election_day,
            division_level=self.NATIONAL_LEVEL,
            jurisdiction=self.FEDERAL_JURISDICTION,
            office=election.race.office,
        )
        PageContent.objects.get_or_create(
            content_type=ContentType.objects.get_for_model(page_type),
            object_id=page_type.pk,
            election_day=election.election_day,
        )
        # Create state results for president page type
        page_type, created = PageType.objects.get_or_create(
            model_type=ContentType.objects.get(
                app_label='government',
                model='office'
            ),
            election_day=election.election_day,
            division_level=self.STATE_LEVEL,
            jurisdiction=self.FEDERAL_JURISDICTION,
            office=election.race.office,
        )
        PageContent.objects.get_or_create(
            content_type=ContentType.objects.get_for_model(page_type),
            object_id=page_type.pk,
            election_day=election.election_day,
        )
1369630
def workspaces(self, index=None):
        """"""
        c = self.centralWidget()
        if index is None:
            return (c.widget(n) for n in range(c.count()))
        else:
            return c.widget(index)
290057
function printConfiguredUnavailable() {
  if (!argv.invalid) {
    return;
  }

  const configuredUnavailable = _.difference(rules.userRulesNames, rules.stylelintAll);

  if (!configuredUnavailable.length) {
    return;
  }

  const heading = chalk.red.underline('INVALID: Configured rules that are no longer available:');
  const rulesToPrint = _.map(configuredUnavailable, rule => {
    return {
      rule: chalk.redBright(rule)
    };
  });

  printColumns(heading, rulesToPrint);
}
276888
def channels_set_type(self, room_id, a_type, **kwargs):
        """"""
        return self.__call_api_post('channels.setType', roomId=room_id, type=a_type, kwargs=kwargs)
1007841
@VisibleForTesting
  Map<String, String> printableJobProperties(Props jobProps) {
    Predicate<String> keyPredicate = new Predicate<String>() {

      @Override
      public boolean apply(String key) {
        if (StringUtils.isEmpty(key)) {
          return true;
        }
        key = key.toLowerCase();
        return !(key.contains("pass") && key.contains("word"));
      }

    };
    return Maps.filterKeys(jobProps.getFlattened(), keyPredicate);
  }
897228
function canAssignSectionList()
    {
        $access = $this->hasAccessTo( 'section', 'assign' );

        if ( $access['accessWord'] == 'yes' )
        {
            return array( '*' );
        }
        else if ( $access['accessWord'] == 'limited' )
        {
            $allowedSectionIDList = array();
            foreach ( $access['policies'] as $policy )
            {
                if ( isset( $policy['NewSection'] ) )
                {
                    if ( is_array( $policy['NewSection'] ) && !empty( $policy['NewSection'] ) )
                    {
                        $allowedSectionIDList = array_merge( $allowedSectionIDList, $policy['NewSection'] );
                    }
                }
                else
                {
                    return array( '*' );
                }
            }
            $allowedSectionIDList = array_unique( $allowedSectionIDList );
            return $allowedSectionIDList;
        }
        return array();
    }