repo_name stringlengths 7 65 | path stringlengths 5 185 | copies stringlengths 1 4 | size stringlengths 4 6 | content stringlengths 977 990k | license stringclasses 14
values | hash stringlengths 32 32 | line_mean float64 7.18 99.4 | line_max int64 31 999 | alpha_frac float64 0.25 0.95 | ratio float64 1.5 7.84 | autogenerated bool 1
class | config_or_test bool 2
classes | has_no_keywords bool 2
classes | has_few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
sqlalchemy/sqlalchemy | examples/versioned_rows/versioned_rows_w_versionid.py | 2 | 4558 | """Illustrates a method to intercept changes on objects, turning
an UPDATE statement on a single row into an INSERT statement, so that a new
row is inserted with the new data, keeping the old row intact.
This example adds a numerical version_id to the Versioned class as well
as the ability to see which row is the most... | mit | b658faebeb1aae1f04f5e7ca439a6077 | 25.811765 | 78 | 0.672444 | 3.705691 | false | false | false | false |
sqlalchemy/sqlalchemy | test/dialect/mssql/test_deprecations.py | 2 | 7812 | from unittest.mock import Mock
from sqlalchemy import Column
from sqlalchemy import engine_from_config
from sqlalchemy import Integer
from sqlalchemy import MetaData
from sqlalchemy import select
from sqlalchemy import String
from sqlalchemy import Table
from sqlalchemy import testing
from sqlalchemy.dialects.mssql im... | mit | f79043bfa7e49677383c7c9eaaa39339 | 32.242553 | 79 | 0.554275 | 3.436868 | false | true | false | false |
sqlalchemy/sqlalchemy | examples/extending_query/temporal_range.py | 2 | 3634 | """Illustrates a custom per-query criteria that will be applied
to selected entities.
"""
import datetime
from sqlalchemy import Column
from sqlalchemy import DateTime
from sqlalchemy import orm
class HasTemporal:
"""Mixin that identifies a class as having a timestamp column"""
timestamp = Column(
... | mit | 16ff08fac8b4094272152a89fdba0cac | 25.720588 | 76 | 0.574298 | 3.8742 | false | false | false | false |
sqlalchemy/sqlalchemy | examples/custom_attributes/custom_management.py | 2 | 3316 | """Illustrates customized class instrumentation, using
the :mod:`sqlalchemy.ext.instrumentation` extension package.
In this example, mapped classes are modified to
store their state in a dictionary attached to an attribute
named "_goofy_dict", instead of using __dict__.
this example illustrates how to replace SQLAlche... | mit | 67fb7ba198acfb279c93f973d0d37166 | 25.110236 | 76 | 0.635404 | 3.81588 | false | false | false | false |
sqlalchemy/sqlalchemy | test/dialect/mssql/test_compiler.py | 2 | 65396 | from sqlalchemy import bindparam
from sqlalchemy import Column
from sqlalchemy import Computed
from sqlalchemy import delete
from sqlalchemy import exc
from sqlalchemy import extract
from sqlalchemy import func
from sqlalchemy import Identity
from sqlalchemy import Index
from sqlalchemy import insert
from sqlalchemy im... | mit | 5fb0595478a56d7c9aa04184cfebad7f | 32.028283 | 79 | 0.500443 | 3.732648 | false | true | false | false |
sqlalchemy/sqlalchemy | lib/sqlalchemy/sql/__init__.py | 2 | 5611 | # sql/__init__.py
# Copyright (C) 2005-2022 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
from typing import Any
from typing import TYPE_CHECKING
from .base import Executabl... | mit | e33fefb85a2d60190eb7987debd8e960 | 38.794326 | 78 | 0.801996 | 4.193572 | false | false | false | false |
sqlalchemy/sqlalchemy | test/ext/asyncio/test_session_py3k.py | 2 | 28202 | from sqlalchemy import Column
from sqlalchemy import event
from sqlalchemy import exc
from sqlalchemy import ForeignKey
from sqlalchemy import func
from sqlalchemy import inspect
from sqlalchemy import Integer
from sqlalchemy import select
from sqlalchemy import Sequence
from sqlalchemy import Table
from sqlalchemy imp... | mit | 2d59f273043e405d6033572da03c6ba5 | 27.429435 | 79 | 0.579569 | 4.001987 | false | true | false | false |
sqlalchemy/sqlalchemy | lib/sqlalchemy/dialects/mysql/provision.py | 2 | 3123 | # mypy: ignore-errors
from ... import exc
from ...testing.provision import configure_follower
from ...testing.provision import create_db
from ...testing.provision import drop_db
from ...testing.provision import generate_driver_url
from ...testing.provision import temp_table_keyword_args
from ...testing.provision impor... | mit | f75c976390ff63258ea0cd75a63ca50a | 31.195876 | 79 | 0.658662 | 3.501121 | false | true | false | false |
sqlalchemy/sqlalchemy | test/aaa_profiling/test_orm.py | 2 | 36185 | from sqlalchemy import and_
from sqlalchemy import ForeignKey
from sqlalchemy import Integer
from sqlalchemy import join
from sqlalchemy import select
from sqlalchemy import String
from sqlalchemy import testing
from sqlalchemy.orm import aliased
from sqlalchemy.orm import Bundle
from sqlalchemy.orm import configure_ma... | mit | 63bea3bc1dad9cb0284e31b723cd5ebf | 26.454476 | 79 | 0.504242 | 3.932725 | false | true | false | false |
sqlalchemy/sqlalchemy | lib/sqlalchemy/ext/mypy/decl_class.py | 2 | 17380 | # ext/mypy/decl_class.py
# Copyright (C) 2021 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
from __future__ import annotations
from typing import List
from typing import Op... | mit | 8b88c4288d879ab1df201691ecfd55a9 | 32.552124 | 79 | 0.590736 | 4.077898 | false | false | false | false |
getnikola/plugins | v7/static_comments/static_comments.py | 1 | 10172 | from __future__ import unicode_literals, print_function, absolute_import
from nikola.plugin_categories import SignalHandler
from nikola import utils
import blinker
import hashlib
import os
import re
__all__ = []
_LOGGER = utils.get_logger('static_comments', utils.STDERR_HANDLER)
class Comment(object):
"""Repr... | mit | 6973d8baa0af33eacbfc8dc07a30b76d | 40.518367 | 163 | 0.580122 | 4.330353 | false | false | false | false |
sqlalchemy/sqlalchemy | test/orm/test_selectable.py | 4 | 3124 | """Generic mapping to Select statements"""
import sqlalchemy as sa
from sqlalchemy import column
from sqlalchemy import Integer
from sqlalchemy import select
from sqlalchemy import String
from sqlalchemy import testing
from sqlalchemy.orm import Session
from sqlalchemy.testing import assert_raises
from sqlalchemy.testi... | mit | af2dcb632dd1ce5955f7a5da5c038f00 | 31.541667 | 78 | 0.627081 | 4.036176 | false | true | false | false |
getnikola/plugins | v7/spell_check/spell_check.py | 4 | 3572 | # -*- coding: utf-8 -*-
# Copyright © 2014 Puneeth Chaganti
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the
# Software without restriction, including without limitation
# the rights to use, copy, mo... | mit | 5d1beb73aa0ffb2b052bfbf8009f49d1 | 34.71 | 79 | 0.608793 | 4.30241 | false | false | false | false |
sqlalchemy/sqlalchemy | lib/sqlalchemy/sql/_elements_constructors.py | 2 | 56154 | # sql/_elements_constructors.py
# Copyright (C) 2005-2022 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
from __future__ import annotations
import typing
from typing import ... | mit | 5eaf732455b3f232ca01efad99084fa4 | 32.766687 | 83 | 0.654557 | 4.252158 | false | false | false | false |
getnikola/plugins | tests/test_microdata.py | 1 | 5977 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from pytest import fixture
from . import V7_PLUGIN_PATH
def test_itemprop(do_test):
assert do_test("""\
:itemprop:`Test <name>`
""") == (
'<p><span itemprop="name">Test</span></p>'
)
def test_itemprop_imag... | mit | 7c79a8888d54729ea1921bc1f8fd9097 | 26.417431 | 125 | 0.514472 | 3.464928 | false | true | false | false |
getnikola/plugins | v8/orgmode/orgmode.py | 1 | 4395 | # -*- coding: utf-8 -*-
# Copyright © 2012-2013 Puneeth Chaganti and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the
# Software without restriction, including without limitation
# the rights... | mit | 820fa5ad921a626715f93422bd9a0457 | 36.237288 | 97 | 0.606509 | 4.18078 | false | false | false | false |
sqlalchemy/sqlalchemy | test/ext/mypy/plain_files/keyfunc_dict.py | 2 | 1068 | import typing
from typing import Optional
from sqlalchemy import ForeignKey
from sqlalchemy.orm import attribute_keyed_dict
from sqlalchemy.orm import DeclarativeBase
from sqlalchemy.orm import Mapped
from sqlalchemy.orm import mapped_column
from sqlalchemy.orm import relationship
class Base(DeclarativeBase):
pa... | mit | c76bcedabdf2d8a1df52d2277adf9ddb | 22.733333 | 63 | 0.685393 | 3.490196 | false | false | false | false |
sqlalchemy/sqlalchemy | examples/asyncio/async_orm.py | 2 | 2958 | """Illustrates use of the sqlalchemy.ext.asyncio.AsyncSession object
for asynchronous ORM use.
"""
import asyncio
from sqlalchemy import Column
from sqlalchemy import DateTime
from sqlalchemy import ForeignKey
from sqlalchemy import func
from sqlalchemy import Integer
from sqlalchemy import String
from sqlalchemy.ex... | mit | 5acf341b605a2ee68acc1f95ad316b58 | 27.442308 | 71 | 0.630832 | 4.013569 | false | false | false | false |
sqlalchemy/sqlalchemy | lib/sqlalchemy/util/typing.py | 2 | 13499 | # util/typing.py
# Copyright (C) 2022 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
# mypy: allow-untyped-defs, allow-untyped-calls
from __future__ import annotations
impor... | mit | 0a7174ea6f6c78dbdaa29dbdbb8ae5db | 26.492872 | 78 | 0.629899 | 3.81867 | false | false | false | false |
sqlalchemy/sqlalchemy | examples/sharding/separate_databases.py | 2 | 9548 | """Illustrates sharding using distinct SQLite databases."""
import datetime
from sqlalchemy import Column
from sqlalchemy import create_engine
from sqlalchemy import DateTime
from sqlalchemy import Float
from sqlalchemy import ForeignKey
from sqlalchemy import inspect
from sqlalchemy import Integer
from sqlalchemy im... | mit | ba67c7a4eccfe692e76e4ec657cd6883 | 30.72093 | 79 | 0.673544 | 3.864023 | false | false | false | false |
sqlalchemy/sqlalchemy | lib/sqlalchemy/orm/evaluator.py | 2 | 11177 | # orm/evaluator.py
# Copyright (C) 2005-2022 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
# mypy: ignore-errors
from __future__ import annotations
from . import exc as or... | mit | ca0f7cae78031c92e59d662df7b70d0c | 31.681287 | 79 | 0.581551 | 4.186142 | false | false | false | false |
sqlalchemy/sqlalchemy | examples/association/basic_association.py | 8 | 3344 | """Illustrate a many-to-many relationship between an
"Order" and a collection of "Item" objects, associating a purchase price
with each via an association object called "OrderItem"
The association object pattern is a form of many-to-many which
associates additional data with each association between parent/child.
The... | mit | 49007eb662fd42b0586b9d2ac0bc8776 | 28.59292 | 79 | 0.676435 | 3.774266 | false | false | false | false |
sqlalchemy/sqlalchemy | examples/asyncio/greenlet_orm.py | 4 | 2360 | """Illustrates use of the sqlalchemy.ext.asyncio.AsyncSession object
for asynchronous ORM use, including the optional run_sync() method.
"""
import asyncio
from sqlalchemy import Column
from sqlalchemy import ForeignKey
from sqlalchemy import Integer
from sqlalchemy import String
from sqlalchemy.ext.asyncio import ... | mit | 35cc565323c3fad43e48e097a6920f6c | 24.376344 | 71 | 0.637288 | 3.973064 | false | false | false | false |
getnikola/plugins | v8/medium/medium_plugin.py | 1 | 3316 | # -*- coding: utf-8 -*-
# Copyright © 2017 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the
# Software without restriction, including without limitation
# the rights to use... | mit | 8c283ee37bb546930d7edf3f4150dc9e | 34.265957 | 134 | 0.613273 | 4.112903 | false | false | false | false |
sqlalchemy/sqlalchemy | test/ext/mypy/plugin_files/dataclasses_workaround.py | 2 | 1850 | # PYTHON_VERSION>=3.7
from __future__ import annotations
from dataclasses import dataclass
from dataclasses import field
from typing import Any
from typing import Dict
from typing import List
from typing import Optional
from typing import TYPE_CHECKING
from sqlalchemy import Column
from sqlalchemy import ForeignKey
... | mit | 5c579dca68af376f7b80dc2ca3d955fa | 25.428571 | 70 | 0.676216 | 3.838174 | false | false | false | false |
getnikola/plugins | v8/book_figure/book_figure.py | 2 | 5370 | # -*- coding: utf-8 -*-
# Copyright © 2014 Ivan Teoh and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the
# Software without restriction, including without limitation
# the rights to use, cop... | mit | 27886d11729234ddc7cb527547addf35 | 30.397661 | 89 | 0.602906 | 3.600939 | false | false | false | false |
sqlalchemy/sqlalchemy | lib/sqlalchemy/dialects/postgresql/psycopg.py | 2 | 21948 | # postgresql/psycopg2.py
# Copyright (C) 2005-2022 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
# mypy: ignore-errors
r"""
.. dialect:: postgresql+psycopg
:name: psycop... | mit | e866f90bcb67eefec05b40592e625d91 | 28.901907 | 97 | 0.622745 | 4.179775 | false | false | false | false |
sqlalchemy/sqlalchemy | lib/sqlalchemy/orm/session.py | 2 | 176823 | # orm/session.py
# Copyright (C) 2005-2022 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Provides the Session class and related utilities."""
from __future__ import anno... | mit | ce77f419b06122548241e3c88f988202 | 35.086327 | 84 | 0.597897 | 4.595909 | false | false | false | false |
sqlalchemy/sqlalchemy | lib/sqlalchemy/orm/clsregistry.py | 2 | 17078 | # ext/declarative/clsregistry.py
# Copyright (C) 2005-2022 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Routines to handle the string class registry used by declarative.... | mit | bd16dba50bd0dbc3fbc51f8c2938a507 | 30.221207 | 77 | 0.584553 | 4.138115 | false | false | false | false |
sqlalchemy/sqlalchemy | lib/sqlalchemy/sql/visitors.py | 2 | 36429 | # sql/visitors.py
# Copyright (C) 2005-2022 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Visitor/traversal interface and library functions.
"""
from __future__ import... | mit | 0e0041d4d06c1fa80afa04992dda917b | 29.845893 | 107 | 0.645255 | 4.162839 | false | false | false | false |
sqlalchemy/sqlalchemy | lib/sqlalchemy/orm/loading.py | 2 | 51663 | # orm/loading.py
# Copyright (C) 2005-2022 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
# mypy: ignore-errors
"""private module containing functions used to convert databa... | mit | 46747b8f6b9d3df0c3cae25735f31255 | 32.612882 | 97 | 0.564485 | 4.491263 | false | false | false | false |
adobe/brackets-shell | gyp/pylib/gyp/mac_tool.py | 4 | 27174 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Utility functions to perform Xcode-style build steps.
These functions are executed via gyp-mac-tool when using the Makefile generator.
""... | mit | 28f92315758e260d58b4742b4a36bb4a | 36.899582 | 105 | 0.656068 | 3.843564 | false | false | false | false |
datactive/bigbang | bigbang/analysis/twopeople.py | 1 | 3903 | """
twopeople.py
Written by Raj Agrawal and Ki Deuk Kim
Contains functions used to analyze communication between two people in mailing list
Examples can be found in ipython notebook "Collaboration Robustness" in examples folder
Each function needs a pandas DataFrame called "exchanges" that contains every two-pair
com... | mit | 74fd34605f28227c9f22d24729d9caff | 30.224 | 87 | 0.610812 | 3.623955 | false | false | false | false |
adobe/brackets-shell | gyp/pylib/gyp/input.py | 11 | 116141 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from compiler.ast import Const
from compiler.ast import Dict
from compiler.ast import Discard
from compiler.ast import List
from compiler.ast import Module
from co... | mit | 6f79e382ed40259144eba1fadeda88c6 | 39.062435 | 80 | 0.654506 | 4.13475 | false | false | false | false |
ccxt/ccxt | python/ccxt/async_support/ascendex.py | 1 | 125883 | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.async_support.base.exchange import Exchange
import hashlib
from ccxt.base.errors import ExchangeError
from ccxt.base.errors impor... | mit | 8d62a4983717eb6019bd018dd364819f | 43.481625 | 228 | 0.476713 | 4.159084 | false | false | false | false |
ccxt/ccxt | python/ccxt/coinone.py | 1 | 34106 | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
import hashlib
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import ArgumentsReq... | mit | 04b25dd9bb032d31793e5844403efccb | 39.171967 | 223 | 0.491996 | 4.178121 | false | false | false | false |
ccxt/ccxt | python/ccxt/zaif.py | 1 | 27588 | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
import hashlib
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import BadRequest
f... | mit | d6f9b6d362a9385b9f4fb5aae6937a8a | 38.867052 | 178 | 0.477381 | 4.078652 | false | false | false | false |
ccxt/ccxt | examples/ccxt.pro/py/binance-watch-order-book-individual-updates.py | 1 | 1138 | # -*- coding: utf-8 -*-
from asyncio import run
import ccxt.pro as ccxt
class MyBinance(ccxt.binance):
def handle_order_book_message(self, client, message, orderbook):
asks = self.safe_value(message, 'a', [])
bids = self.safe_value(message, 'b', [])
# printing high-frequency updates is a ... | mit | 35c83228b99e9d7395d633184d447d3b | 32.470588 | 92 | 0.616872 | 3.83165 | false | false | false | false |
ccxt/ccxt | python/ccxt/async_support/mexc3.py | 1 | 188324 | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.async_support.base.exchange import Exchange
import hashlib
from ccxt.base.errors import ExchangeError
from ccxt.base.errors impor... | mit | 4c1eaaa7b754751bbe453093ad338712 | 43.117647 | 461 | 0.466996 | 4.231003 | false | false | false | false |
ccxt/ccxt | python/ccxt/lbank.py | 1 | 33395 | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from cc... | mit | 39cb4dab7c04e680b2df3fd78c99ff7f | 39.310386 | 155 | 0.508704 | 4.168998 | false | false | false | false |
ccxt/ccxt | examples/py/ftx-market-order-fees.py | 1 | 1800 | # -*- coding: utf-8 -*-
import os
import sys
from pprint import pprint
root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(root + '/python')
import ccxt # noqa: E402
print('CCXT Version:', ccxt.__version__)
def table(values):
first = values[0]
keys = list(... | mit | 04ce44f0022949f4b7bd7a14a390bcc1 | 28.508197 | 90 | 0.542778 | 3.454894 | false | false | false | false |
ccxt/ccxt | python/ccxt/blockchaincom.py | 1 | 46628 | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from cc... | mit | 9738fdd77ed98230f850028a6d9467c7 | 42.78216 | 155 | 0.538389 | 4.162471 | false | false | false | false |
ccxt/ccxt | python/ccxt/async_support/paymium.py | 1 | 22731 | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.async_support.base.exchange import Exchange
from ccxt.base.errors import ExchangeError
from ccxt.base.decimal_to_precision import... | mit | 4fcf872aad1ee270df17fa26cdb078cd | 40.784926 | 158 | 0.511328 | 3.994201 | false | false | false | false |
ccxt/ccxt | python/ccxt/async_support/kucoinfutures.py | 1 | 89071 | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.async_support.kucoin import kucoin
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import PermissionDenied... | mit | ec02b9b629c8d57b741449b2ec9452b2 | 44.699846 | 352 | 0.50041 | 4.14834 | false | false | false | false |
ccxt/ccxt | python/ccxt/pro/binance.py | 1 | 67107 | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.pro.base.exchange import Exchange
import ccxt.async_support
from ccxt.pro.base.cache import ArrayCache, ArrayCacheBySymbolById, A... | mit | e128271b62d762d15a59eb23c47b417b | 47.628261 | 204 | 0.497221 | 4.131696 | false | false | false | false |
ccxt/ccxt | examples/py/async-tickers-from-many-exchanges-at-once.py | 1 | 1184 | # -*- coding: utf-8 -*-
import asyncio
import ccxt
import ccxt.async_support as ccxta # noqa: E402
import time
import os
import sys
root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(root + '/python')
def sync_client(exchange):
client = getattr(ccxt, exchange)()... | mit | b11e769461d4d1100085283c90ab671d | 24.73913 | 83 | 0.67652 | 3.325843 | false | false | false | false |
ccxt/ccxt | python/ccxt/yobit.py | 1 | 50442 | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
import hashlib
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import Authenticati... | mit | d1f0763ffb16058cdc229237e1b9c54e | 40.615512 | 263 | 0.479519 | 4.159492 | false | false | false | false |
ccxt/ccxt | examples/py/huobi-swaps.py | 1 | 1946 | # -*- coding: utf-8 -*-
import os
from random import randint
import sys
from pprint import pprint
root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(root + '/python')
import ccxt # noqa: E402
print('CCXT Version:', ccxt.__version__)
exchange = ccxt.huobi({
'ap... | mit | 2aa7f1d61e1e40a15763b1bfb71c1402 | 21.113636 | 83 | 0.66444 | 3.270588 | false | false | false | false |
ccxt/ccxt | python/ccxt/async_support/bybit.py | 1 | 265899 | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.async_support.base.exchange import Exchange
import asyncio
import hashlib
import json
from ccxt.base.errors import ExchangeError
... | mit | c53f24e17efb154100fb82a843cbad95 | 45.041732 | 571 | 0.477094 | 3.961959 | false | false | false | false |
ccxt/ccxt | python/ccxt/btctradeua.py | 1 | 21636 | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import ArgumentsRequired
from ccxt... | mit | 5a6d947f2d0431c21c44dc72d3a1a8c6 | 44.075 | 278 | 0.519689 | 3.716249 | false | false | false | false |
ccxt/ccxt | python/ccxt/luno.py | 1 | 39681 | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import ArgumentsRequired
from ccxt... | mit | 327de7b83e9aa89d901c5990f1ab31f1 | 41.124204 | 155 | 0.509009 | 4.192393 | false | false | false | false |
ccxt/ccxt | python/ccxt/pro/base/client.py | 1 | 7230 | # -*- coding: utf-8 -*-
from asyncio import sleep, ensure_future, wait_for, TimeoutError
from .functions import milliseconds, iso8601, deep_extend
from ccxt import NetworkError, RequestTimeout, NotSupported
from ccxt.pro.base.future import Future
class Client(object):
url = None
ws = None
futures = {}
... | mit | 8e05eac4f580ed6638d20fd27e7b4d9d | 36.65625 | 121 | 0.608022 | 4.283175 | false | false | false | false |
ccxt/ccxt | python/ccxt/lbank2.py | 1 | 88893 | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from cc... | mit | a81d3f147280b00849fd5e4fb4670c4f | 41.35796 | 467 | 0.476442 | 4.147624 | false | false | false | false |
ccxt/ccxt | python/ccxt/async_support/wazirx.py | 1 | 34588 | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.async_support.base.exchange import Exchange
import hashlib
from ccxt.base.errors import ExchangeError
from ccxt.base.errors impor... | mit | a6d08bfd8cb623771d0e379bdbad8887 | 39.312354 | 160 | 0.497832 | 4.084554 | false | false | false | false |
ccxt/ccxt | examples/py/fetch-bitfinex-ohlcv-history.py | 1 | 1923 | # -*- coding: utf-8 -*-
import os
import sys
import time
# -----------------------------------------------------------------------------
root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(root + '/python')
# -----------------------------------------------------------... | mit | b7d9ceb623fafc4b5790a71657a1d0fa | 31.59322 | 115 | 0.447738 | 4.292411 | false | false | false | false |
ccxt/ccxt | python/ccxt/static_dependencies/ecdsa/util.py | 1 | 10037 | from __future__ import division
import os
import math
import binascii
from hashlib import sha256
from . import der
from .curves import orderlen
# RFC5480:
# The "unrestricted" algorithm identifier is:
# id-ecPublicKey OBJECT IDENTIFIER ::= {
# iso(1) member-body(2) us(840) ansi-X9-62(10045) keyType(2) 1 }... | mit | 254707a316f60e0b0660777c672bfae5 | 36.733083 | 89 | 0.654678 | 3.464619 | false | false | false | false |
ccxt/ccxt | python/ccxt/async_support/bitopro.py | 1 | 62980 | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.async_support.base.exchange import Exchange
import hashlib
import math
from ccxt.base.errors import ExchangeError
from ccxt.base.... | mit | 73783b404eef7bf871acb1770a5c19ce | 40.298361 | 155 | 0.477644 | 4.279114 | false | false | false | false |
ccxt/ccxt | python/ccxt/pro/test/test_order_book.py | 1 | 14757 | import os
import sys
root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
sys.path.append(root)
# ----------------------------------------------------------------------------
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/... | mit | 9ed5b037e7ed466f238037d7155b9ee0 | 36.838462 | 139 | 0.5823 | 2.675793 | false | false | false | false |
ccxt/ccxt | python/ccxt/async_support/zaif.py | 1 | 27770 | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.async_support.base.exchange import Exchange
import hashlib
from ccxt.base.errors import ExchangeError
from ccxt.base.errors impor... | mit | d204ea047c4bcd2b17d43f8123781605 | 39.130058 | 178 | 0.479726 | 4.086227 | false | false | false | false |
ccxt/ccxt | python/ccxt/async_support/btcmarkets.py | 1 | 48258 | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.async_support.base.exchange import Exchange
import hashlib
from ccxt.base.errors import ExchangeError
from ccxt.base.errors impor... | mit | 5f0d093d4040f0817cc9cd013913eb2a | 41.220472 | 170 | 0.517448 | 4.08205 | false | false | false | false |
ccxt/ccxt | examples/py/async-binance-fetch-option-OHLCV.py | 1 | 1203 | # -*- coding: utf-8 -*-
# This example uses the implicit API, in the future we will have options unified which will make things easier.
# You can check if the unified methods are ready-to-use (createOrder, fetchOrder etc) by checking: `is_unified = exchange.has['option']`
import asyncio
import os
import sys
from pprin... | mit | efc81bd3516ed2894b9ad2fc946b9114 | 28.341463 | 136 | 0.62926 | 3.538235 | false | false | false | false |
ccxt/ccxt | python/ccxt/kucoin.py | 1 | 151256 | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
import hashlib
import math
import json
from ccxt.base.errors import ExchangeError
from ccxt.base.er... | mit | 3dfbe63801c1b57d0d239d081d8a3bff | 45.719184 | 184 | 0.491205 | 4.091831 | false | false | false | false |
ccxt/ccxt | examples/py/gateio-swaps.py | 1 | 1854 | # -*- coding: utf-8 -*-
import os
from random import randint
import sys
root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(root + '/python')
import ccxt # noqa: E402
print('CCXT Version:', ccxt.__version__)
exchange = ccxt.gateio({
'apiKey': 'YOUR_API_KEY',
... | mit | 50370e15acca78bb7d284c0e419e0815 | 22.1875 | 84 | 0.667745 | 3.275618 | false | false | false | false |
ccxt/ccxt | examples/py/binance-fetch-ohlcv-closing-time-2.py | 1 | 1474 | # -*- coding: utf-8 -*-
import os
import sys
import asciichart
# -----------------------------------------------------------------------------
this_folder = os.path.dirname(os.path.abspath(__file__))
root_folder = os.path.dirname(os.path.dirname(this_folder))
sys.path.append(root_folder + '/python')
sys.path.append(... | mit | 6f2513f253a69d9259550ec1fe87b121 | 26.296296 | 79 | 0.416554 | 3.484634 | false | false | false | false |
defunkt/pystache | pystache/specloader.py | 43 | 2519 | # coding: utf-8
"""
This module supports customized (aka special or specified) template loading.
"""
import os.path
from pystache.loader import Loader
# TODO: add test cases for this class.
class SpecLoader(object):
"""
Supports loading custom-specified templates (from TemplateSpec instances).
"""
... | mit | 15ce7bd15730ca256f359c8f0ae1c3ee | 26.988889 | 90 | 0.626836 | 4.305983 | false | false | false | false |
ccxt/ccxt | examples/py/async-binance-futures-vs-spot.py | 1 | 1386 | # -*- coding: utf-8 -*-
import asyncio
import os
import sys
from pprint import pprint
root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(root + '/python')
import ccxt.async_support as ccxt # noqa: E402
async def load(exchange, symbol, type='spot'):
exchange.opt... | mit | f7a3bfe94b9f32e0a765cd62ce02f81f | 28.489362 | 83 | 0.612554 | 3.735849 | false | false | false | false |
ccxt/ccxt | examples/py/async-fetch-many-orderbooks-continuously.py | 1 | 1481 | # -*- coding: utf-8 -*-
import os
import sys
from asyncio import gather, run
root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(root + '/python')
import ccxt.async_support as ccxt # noqa: E402
async def symbol_loop(exchange, symbol):
print('Starting the', excha... | mit | 77c755f191237b8701306d9251daff89 | 30.510638 | 105 | 0.610398 | 3.543062 | false | false | false | false |
ccxt/ccxt | build/export-docs.py | 1 | 1627 | import re
import m2r2
import os
files = [
'wiki/Manual',
'wiki/Exchange-Markets-By-Country',
'wiki/Exchange-Markets',
'wiki/ccxt.pro.manual',
'README',
]
for file in files:
with open(file + '.md', 'r') as f:
contents = f.read()
# .md parsing stage
stripped = re.sub(r'</?su[bp]... | mit | 82e496025c44c57278ebeb28add8b873 | 40.717949 | 101 | 0.56976 | 2.729866 | false | false | false | false |
ccxt/ccxt | python/ccxt/async_support/lbank.py | 1 | 33631 | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.async_support.base.exchange import Exchange
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import Authenticatio... | mit | 848d48f7cb468e44aef7b16ac53fc50f | 39.595411 | 155 | 0.510993 | 4.177085 | false | false | false | false |
ccxt/ccxt | python/ccxt/pro/hollaex.py | 1 | 21349 | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.pro.base.exchange import Exchange
import ccxt.async_support
from ccxt.pro.base.cache import ArrayCache, ArrayCacheBySymbolById
fr... | mit | 59c9871c9fbe6058d00f6a75758efb8b | 37.397482 | 155 | 0.48288 | 3.983022 | false | false | false | false |
ccxt/ccxt | examples/py/async-analyse-augur-v1-vs-v2-exchanges.py | 1 | 2769 | # -*- coding: utf-8 -*-
import asyncio
import os
import sys
from typing import Optional
root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(root + '/python')
import ccxt.async_support as ccxt
unchecked_exchanges = []
def is_symbol_match(
symbol: str,
allowe... | mit | aa4966af9495dad2e4e79023c4a0bf68 | 30.465909 | 154 | 0.613579 | 3.984173 | false | false | false | false |
ccxt/ccxt | python/ccxt/crex24.py | 1 | 78045 | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
import hashlib
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import Authenticati... | mit | 409a8899591152a8f7e95d2348d043bb | 43.018613 | 474 | 0.491383 | 4.112827 | false | false | false | false |
ccxt/ccxt | examples/ccxt.pro/py/many-exchanges-many-different-streams.py | 1 | 1946 | # -*- coding: utf-8 -*-
import ccxt.pro
from asyncio import gather, run
async def symbol_loop(exchange, method, symbol):
print('Starting', exchange.id, method, symbol)
while True:
try:
response = await getattr(exchange, method)(symbol)
now = exchange.milliseconds()
... | mit | 1dc9d3c9d32c6f06d5f2441d82d971a2 | 33.75 | 128 | 0.599178 | 3.823183 | false | false | false | false |
ccxt/ccxt | examples/py/fetch-ohlcv-cex.py | 2 | 1348 | # -*- coding: utf-8 -*-
import os
import sys
import asciichart
# -----------------------------------------------------------------------------
this_folder = os.path.dirname(os.path.abspath(__file__))
root_folder = os.path.dirname(os.path.dirname(this_folder))
sys.path.append(root_folder + '/python')
sys.path.append(... | mit | a9dab2247453505e1968697e9b35dde1 | 27.041667 | 90 | 0.532689 | 3.478036 | false | false | false | false |
ccxt/ccxt | python/ccxt/gemini.py | 1 | 63673 | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
import hashlib
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import Authenticati... | mit | 957b8f52fb5f61eb8630fc7ebc72cc65 | 42.373978 | 270 | 0.50194 | 4.09578 | false | false | false | false |
ccxt/ccxt | examples/ccxt.pro/py/binance-watch-orders-being-placed.py | 1 | 1752 | # Python
import ccxt.pro
from asyncio import run, gather
from pprint import pprint
async def place_delayed_order(exchange, symbol, amount, price):
try:
await exchange.sleep(5000) # wait a bit
order = await exchange.create_limit_buy_order(symbol, amount, price)
print(exchange.iso8601(excha... | mit | 15ce3a076d87144078f372668904086d | 28.694915 | 117 | 0.52968 | 4.38 | false | false | false | false |
ccxt/ccxt | python/ccxt/therock.py | 1 | 69544 | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
import hashlib
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import ArgumentsReq... | mit | 50062a4873224dcdbd0584e454e3ba9a | 41.612745 | 163 | 0.469918 | 4.012231 | false | false | false | false |
ccxt/ccxt | examples/py/fetch_longer_ohlcv_through_multiple_calls_and_save_to_csv.py | 1 | 1124 | # -*- coding: utf-8 -*-
import os
import sys
import ccxt # noqa: E402
import numpy as np
from datetime import datetime
root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(root + '/python')
print('CCXT Version:', ccxt.__version__)
# data
exchange_name = 'ftx'
symbol =... | mit | 3863faf76aab589bbacd7e16ae324026 | 20.207547 | 85 | 0.625445 | 2.682578 | false | false | false | false |
ccxt/ccxt | python/ccxt/test/test_trade.py | 1 | 3243 | # -*- coding: utf-8 -*-
import numbers # noqa E402
def test_trade(exchange, trade, symbol, now):
assert trade
sampleTrade = {
'info': {'a': 1, 'b': 2, 'c': 3}, # the original decoded JSON as is
'id': '12345-67890:09876/54321', # string trade id
'timestamp': 1502962946216, ... | mit | 59dbe3f0d8353629b5339e0ee533e64e | 48.136364 | 172 | 0.593586 | 3.723307 | false | false | false | false |
ccxt/ccxt | python/ccxt/async_support/cryptocom.py | 1 | 101574 | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.async_support.base.exchange import Exchange
import asyncio
from ccxt.base.errors import ExchangeError
from ccxt.base.errors impor... | mit | a186a8b14675ce9d10850f7b33d5b8d2 | 43.009532 | 254 | 0.496318 | 4.001182 | false | false | false | false |
ccxt/ccxt | python/ccxt/async_support/bitget.py | 1 | 170821 | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.async_support.base.exchange import Exchange
import hashlib
from ccxt.base.errors import ExchangeError
from ccxt.base.errors impor... | mit | 9383b0149fedfe5ea0b9b19a159bf9ad | 48.319757 | 341 | 0.515371 | 4.180213 | false | false | false | false |
ccxt/ccxt | examples/ccxt.pro/py/many-exchanges-many-orderbooks-throttled.py | 1 | 1665 | # -*- coding: utf-8 -*-
import ccxt.pro
from asyncio import run, gather, sleep
orderbooks = {}
def handle_all_orderbooks(orderbooks):
print('We have the following orderbooks:')
for exchange_id, orderbooks_by_symbol in orderbooks.items():
for symbol in orderbooks_by_symbol.keys():
orderb... | mit | b511aead454cfb527c2ba194ff49ce1e | 28.732143 | 133 | 0.637237 | 3.7 | false | false | false | false |
ccxt/ccxt | python/ccxt/pro/test/exchange/test_watch_ohlcv.py | 1 | 1560 | # -*- coding: utf-8 -*-
from ccxt import NetworkError
from ccxt.test import test_ohlcv
async def test_watch_ohlcv(exchange, symbol):
# todo add real ohlcv tests here
# log (symbol.green, 'watching ohlcvs...')
method = 'watchOHLCV'
skipped_exchanges = [
'dsx',
'idex2', # rinkeby test... | mit | 701d18b4f3c84dee3625cc6a5b48b783 | 32.191489 | 120 | 0.592308 | 3.670588 | false | true | false | false |
ccxt/ccxt | examples/py/async-binance-cancel-option-order.py | 1 | 1092 | # -*- coding: utf-8 -*-
# This example uses the implicit API, in the future we will have options unified which will make things easier.
# You can check if the unified methods are ready-to-use (createOrder, fetchOrder etc) by checking: `is_unified = exchange.has['option']`
import asyncio
import os
import sys
from pprin... | mit | ed6f86e48fb4ab9ad1789485be648dc3 | 28.513514 | 136 | 0.650183 | 3.5 | false | false | false | false |
ccxt/ccxt | python/ccxt/async_support/bitvavo.py | 1 | 76082 | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.async_support.base.exchange import Exchange
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import Authenticatio... | mit | 30c1ecb996fdc089b9335593f8d67f31 | 44.694895 | 340 | 0.515155 | 4.084282 | false | false | false | false |
opps/opps | opps/core/templatetags/encoding_tags.py | 4 | 1085 |
from xml.parsers import expat
from HTMLParser import HTMLParser
from django import template
register = template.Library()
parser = HTMLParser()
def unescape(s):
want_unicode = False
if isinstance(s, unicode):
s = s.encode("utf-8")
want_unicode = True
# the rest of this assumes that `s` ... | mit | 236c63fe20d53f6dc10a139f239ad229 | 22.085106 | 53 | 0.642396 | 3.690476 | false | false | false | false |
opps/opps | opps/core/permissions/views.py | 3 | 1489 | # -*- coding: utf-8 -*-
from grappelli.views.related import AutocompleteLookup
from django.db.models import Q
from django.conf import settings
from django.contrib.sites.models import Site
from opps.core.models import Publisher, Channeling
from opps.channels.models import Channel
from .models import Permission
FALL... | mit | e7131f487f6314cd9525b1307325c952 | 31.369565 | 78 | 0.618536 | 3.897906 | false | false | false | false |
opps/opps | opps/archives/admin.py | 4 | 1710 | # coding: utf-8
from django.contrib import admin
from django.contrib.auth import get_user_model
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from opps.core.admin import apply_opps_rules
from opps.core.permissions.admin import AdminViewPermission
from .models import File
... | mit | dd5888a304eb9ea3c0f0d381766bbcfd | 31.264151 | 75 | 0.600585 | 3.72549 | false | false | false | false |
opps/opps | opps/views/generic/json_views.py | 4 | 2943 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from django.http import HttpResponse
from django.views.generic import TemplateView
from django.views.generic.detail import BaseDetailView
from django.views.generic.detail import SingleObjectTemplateResponseMixin
def response_mimetype(request):
if "applicat... | mit | 06850a18b8f23a3283d55a0794318f68 | 34.890244 | 78 | 0.640163 | 4.234532 | false | false | false | false |
opps/opps | opps/db/backends/postgresql_psycopg2/base.py | 5 | 8866 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
INSTALL:
apt-get install postgresql-contrib-9.1
RUN IN DBSHELL
CREATE EXTENSION IF NOT EXISTS unaccent;
USAGE:
DATABASES = {
'default': {
'ENGINE': 'opps.db.backends.postgresql_psycopg2',
...
}
}
SOUTH_DATABASE_ADAPTERS = {
'defaul... | mit | 7fedee56442ed33ae6089f26e4343769 | 35.941667 | 79 | 0.630611 | 4.170273 | false | false | false | false |
opencivicdata/scrapers-ca | ca_qc_terrebonne/people.py | 1 | 1563 | from utils import CanadianScraper, CanadianPerson as Person
COUNCIL_PAGE = 'http://www.ville.terrebonne.qc.ca/fr/10/Conseil_municipal'
class TerrebonnePersonScraper(CanadianScraper):
def scrape(self):
page = self.lxmlize(COUNCIL_PAGE, 'utf-8')
councillors = page.xpath('//div[contains(@class, "mem... | mit | 34e5c049f09e2351552d3efe91f73262 | 46.363636 | 112 | 0.577735 | 3.27673 | false | false | false | false |
opencivicdata/scrapers-ca | ca_qc_sherbrooke/people.py | 1 | 1936 | from utils import CanadianScraper, CanadianPerson as Person, clean_french_prepositions
COUNCIL_PAGE = 'http://www.ville.sherbrooke.qc.ca/mairie-et-vie-democratique/conseil-municipal/elus-municipaux/'
class SherbrookePersonScraper(CanadianScraper):
def scrape(self):
page = self.lxmlize(COUNCIL_PAGE)
... | mit | de99632d0cb2816c88492fd67054ae06 | 44.023256 | 112 | 0.571798 | 3.332186 | false | false | false | false |
botify-labs/simpleflow | examples/signals.py | 1 | 8959 | from __future__ import print_function
import time
from simpleflow import Workflow, activity, futures
from simpleflow.canvas import Chain, Group
from simpleflow.task import ActivityTask
@activity.with_attributes(task_list="quickstart", version="example")
def func_a_1_1(*args, **kwargs):
print("func_a_1_1({}, {})... | mit | f823961a7e3eebe594575f505eed6804 | 26.148485 | 84 | 0.601183 | 3.589343 | false | false | false | false |
opencivicdata/scrapers-ca | disabled/ca_bc_langley/people.py | 1 | 2690 | from utils import CanadianScraper, CanadianPerson as Person
import re
COUNCIL_PAGE = 'http://www.city.langley.bc.ca/index.php/city-hall/city-council'
class LangleyPersonScraper(CanadianScraper):
def scrape(self):
councillor_seat_number = 1
page = self.lxmlize(COUNCIL_PAGE)
councillors ... | mit | fde370b434ffb8b1f9f94b449fbe0ff5 | 37.985507 | 111 | 0.581041 | 3.029279 | false | false | false | false |
opencivicdata/scrapers-ca | disabled/ca_on_kawartha_lakes/people.py | 1 | 1264 | from utils import CanadianScraper, CanadianPerson as Person
import re
COUNCIL_PAGE = 'http://www.city.kawarthalakes.on.ca/city-hall/mayor-council/members-of-council'
class KawarthaLakesPersonScraper(CanadianScraper):
def scrape(self):
page = self.lxmlize(COUNCIL_PAGE)
councillors = page.xpath(... | mit | 1dae2d92145abec4efde0e126fea0acb | 35.114286 | 95 | 0.56962 | 3.326316 | false | false | false | false |
opencivicdata/scrapers-ca | ca_pe_charlottetown/people.py | 1 | 2078 | from utils import CanadianScraper, CanadianPerson as Person
import re
COUNCIL_PAGE = 'https://www.charlottetown.ca/mayor___council/city_council/meet_my_councillor'
class CharlottetownPersonScraper(CanadianScraper):
def scrape(self):
page = self.lxmlize(COUNCIL_PAGE)
nodes = page.xpath('//div[@i... | mit | 42d39aaabf7214590bae251fbf5fa02f | 35.45614 | 96 | 0.497113 | 3.632867 | false | false | false | false |
botify-labs/simpleflow | simpleflow/step/submittable.py | 1 | 5103 | import copy
from typing import TYPE_CHECKING
from simpleflow import activity
from simpleflow.base import SubmittableContainer
from simpleflow.canvas import Chain, FuncGroup
from .tasks import MarkStepDoneTask
from .utils import (
get_step_force_reasons,
get_step_skip_reasons,
step_is_forced,
step_is_s... | mit | 89b471c702c8a3c15346f004d4a0aa64 | 37.954198 | 105 | 0.558691 | 4.406736 | false | false | false | false |
opencivicdata/scrapers-ca | disabled/ca_nt_municipalities/people.py | 1 | 2180 | # coding: utf-8
from utils import CanadianScraper, CanadianPerson as Person
from pupa.scrape import Organization
COUNCIL_PAGE = 'http://www.nwtac.com/about/communities/'
class NorthwestTerritoriesMunicipalitiesPersonScraper(CanadianScraper):
def scrape(self):
page = self.lxmlize(COUNCIL_PAGE)
co... | mit | 32a6d8508206696d1331f2101aae1e3e | 49.627907 | 149 | 0.58475 | 3.592409 | false | false | false | false |
opencivicdata/scrapers-ca | ca_qc_trois_rivieres/people.py | 1 | 1383 | # coding: utf-8
from utils import CanadianScraper, CanadianPerson as Person
import re
COUNCIL_PAGE = 'https://www.v3r.net/a-propos-de-la-ville/vie-democratique/conseil-municipal/maire-et-conseillers-municipaux'
class TroisRivieresPersonScraper(CanadianScraper):
def scrape(self):
page = self.lxmlize(COUN... | mit | b28932915ed0817fa3e8d19fbc978b45 | 39.647059 | 124 | 0.589001 | 3.169725 | false | false | false | false |
botify-labs/simpleflow | examples/basic.py | 1 | 1706 | from __future__ import print_function
import time
from simpleflow import Workflow, activity, futures, logger
@activity.with_attributes(task_list="quickstart", version="example")
def increment(x):
# Here's how you can access the raw context of the activity task if you need
# it. It gives you access to the re... | mit | c38fb66c8a09480e85c6ae83e0a285ec | 31.188679 | 175 | 0.661782 | 3.660944 | false | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.