List all active quotes on an account
589
def cli(env):
    """"""
    table = formatting.Table([
        'Id', 'Name', 'Created', 'Expiration', 'Status', 'Package Name', 'Package Id'
    ])
    table.align['Name'] = 'l'
    table.align['Package Name'] = 'r'
    table.align['Package Id'] = 'l'

    manager = ordering.OrderingManager(env.client)
    items = manager.get_quotes()

    for item in items:
        package = item['order']['items'][0]['package']
        table.add_row([
            item.get('id'),
            item.get('name'),
            clean_time(item.get('createDate')),
            clean_time(item.get('modifyDate')),
            item.get('status'),
            package.get('keyName'),
            package.get('id')
        ])
    env.fout(table)
968956
def show_all(key):
    '''
    
    '''
    def func(request, abbr, session, bill_id, key):
        # get fixed version
        fixed_bill_id = fix_bill_id(bill_id)
        # redirect if URL's id isn't fixed id without spaces
        if fixed_bill_id.replace(' ', '') != bill_id:
            return redirect('bill', abbr=abbr, session=session,
                            bill_id=fixed_bill_id.replace(' ', ''))
        bill = db.bills.find_one({settings.LEVEL_FIELD: abbr,
                                  'session': session,
                                  'bill_id': fixed_bill_id})
        if bill is None:
            raise Http404('no bill found {0} {1} {2}'.format(abbr, session,
                                                             bill_id))
        return render(request, templatename('bill_all_%s' % key),
                      dict(abbr=abbr, metadata=Metadata.get_object(abbr),
                           bill=bill, sources=bill['sources'],
                           nav_active='bills'))
    return func
40493
def list(self):
        
        response = self.client._make_request('/accounts')
        response = response.json()
        return self.client._list_response(response)
1175460
def all(self, customer_id, data={}, **kwargs):
        "
        url = "{}/{}/tokens".format(self.base_url, customer_id)
        return self.get_url(url, data, **kwargs)
1125186
def find_all_by_type(account_type)
        raise AccountsListNotLoadedError unless loaded?
        @accounts.inject([]) do | list, account |
          list << account if account.type == account_type
          list
        end
      end
1259999
def list(self, limit=None, marker=None, name=None, visibility=None,
            member_status=None, owner=None, tag=None, status=None,
            size_min=None, size_max=None, sort_key=None, sort_dir=None,
            return_raw=False):
        
        uri = "/%s" % self.uri_base
        qs = utils.dict_to_qs(dict(limit=limit, marker=marker, name=name,
                visibility=visibility, member_status=member_status,
                owner=owner, tag=tag, status=status, size_min=size_min,
                size_max=size_max, sort_key=sort_key, sort_dir=sort_dir))
        if qs:
            uri = "%s?%s" % (uri, qs)
        return self._list(uri, return_raw=return_raw)
251568
def quoted_or_list(items):
    # type: (List[str]) -> str
    """"""
    selected = items[:MAX_LENGTH]
    quoted_items = ('"{}"'.format(t) for t in selected)

    def quoted_or_text(text, quoted_and_index):
        index = quoted_and_index[0]
        quoted_item = quoted_and_index[1]
        text += (
            (", " if len(selected) > 2 and not index == len(selected) - 1 else " ")
            + ("or " if index == len(selected) - 1 else "")
            + quoted_item
        )
        return text

    enumerated_items = enumerate(quoted_items)
    first_item = next(enumerated_items)[1]
    return functools.reduce(quoted_or_text, enumerated_items, first_item)
1034315
def get_users_list(options={})
      content_type = {'Content-Type' => 'application/json'}
      content_type.merge!(options[:headers]) if options[:headers]

      uri = build_uri("/accounts/#{@acct_id}/users?additional_info=true")

      request = Net::HTTP::Get.new(uri.request_uri, headers(options[:headers]))
      http = initialize_net_http_ssl(uri)
      response = http.request(request)
      generate_log(request, response, uri)

      parsed_response = JSON.parse(response.body)
      (parsed_response || {}).fetch("users", [])
    end
269598
def list_all(self, name=None, visibility=None, member_status=None,
            owner=None, tag=None, status=None, size_min=None, size_max=None,
            sort_key=None, sort_dir=None):
        
        return self._manager.list_all(name=name, visibility=visibility,
                member_status=member_status, owner=owner, tag=tag,
                status=status, size_min=size_min, size_max=size_max,
                sort_key=sort_key, sort_dir=sort_dir)
433836
def _quote_query(query):
    """"""
    return "&".join("%s=%s" % (
        k, urllib_quote(
            unicode(query[k]).encode('utf-8'), safe='~'))
            for k in sorted(query))
393164
def list_accounts(self, id, max_id=None, min_id=None, since_id=None, limit=None):
        
        id = self.__unpack_id(id)
        
        if max_id != None:
            max_id = self.__unpack_id(max_id)
        
        if min_id != None:
            min_id = self.__unpack_id(min_id)
        
        if since_id != None:
            since_id = self.__unpack_id(since_id)
        
        params = self.__generate_params(locals(), ['id']) 
        return self.__api_request('GET', '/api/v1/lists/{0}/accounts'.format(id))
750711
def get_current_info(self, symbolList, columns=None):
        
        response = self.select('yahoo.finance.quotes',columns).where(['symbol','in',symbolList])
        return response
182056
def shlex_quotes(value):
    ''''''
    lex = shlex.shlex(value)
    lex.quotes = '"'
    lex.whitespace_split = True
    lex.commenters = ''
    return list(lex)
976801
def list_users(self):
        
        lines = output_lines(self.exec_psql('\\du'))
        return [line.split('|') for line in lines]
1259265
def quote_names(db, names):
    """"""
    c = db.cursor()
    c.execute("SELECT pg_catalog.quote_ident(n) FROM pg_catalog.unnest(%s::text[]) n", [list(names)])
    return [name for (name,) in c]
576169
def match(self, url):
        
        return list({
            message for message in self.active() if
            message.is_global or message.match(url)
        })
840029
function doQuotes(route, args, count) {
    var bot = this,
        username = args.shift(),
        user;

    count = count || 1;

    function getQuote (err, quotes) {
        if (quotes.length) {
            var quote, output = [];
            for (var i = 0; i < quotes.length; i++) {
                quote = quotes[i];
                output.push(quote.nick + ': ' + quote.text);
            }
            route.indirect().send(output.join('\n'));
        } else {
            var name = 'anyone';
            if (user) {
                name = user.nick;
            }
            route.send('?quotes_nobody_said_that', name);
        }
    }

    if (username !== 'anyone') {
        user = bot.users.getUserMatch(username);

        if (!user) {
            user = bot.db.schemas.quote.getQuoteNick(username, function (err, user) {
                if (!user) {
                    args.unshift(username);
                    bot.db.schemas.quote.random(args.join(' '), null, count, getQuote);
                } else {
                    bot.db.schemas.quote.random(args.join(' '), username, count, getQuote);
                }
            });
        } else {
            bot.db.schemas.quote.random(args.join(' '), user.nick, count, getQuote);
        }
    } else {
        bot.db.schemas.quote.random(args.join(' '), null, count, getQuote);
    }
}