hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f74d1b8fa8a368ca7d36ad0d1080768701df1f5d | 3,428 | py | Python | p3/management/commands/check_schedule.py | malemburg/epcon | 1edec493ac1258950dcabdc9f9ee8b97c24f96c5 | [
"BSD-2-Clause"
] | null | null | null | p3/management/commands/check_schedule.py | malemburg/epcon | 1edec493ac1258950dcabdc9f9ee8b97c24f96c5 | [
"BSD-2-Clause"
] | null | null | null | p3/management/commands/check_schedule.py | malemburg/epcon | 1edec493ac1258950dcabdc9f9ee8b97c24f96c5 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
""" Print accepted talks not scheduled and not accepted talks which have been
scheduled.
"""
from collections import defaultdict
from optparse import make_option
import operator
import simplejson as json
from django.core.management.base import BaseCommand, CommandError
from djan... | 40.809524 | 93 | 0.490665 | from collections import defaultdict
from optparse import make_option
import operator
import simplejson as json
from django.core.management.base import BaseCommand, CommandError
from django.core import urlresolvers
from conference import models
from conference import utils
from conference.mod... | true | true |
f74d1d71291be40e5c29aae2b212ecf1f0fce797 | 8,443 | py | Python | docs/conf.py | ChattanoogaPublicLibrary/booksforcha | 1d4106acde35e3374b4a42ecb60798fcd279752e | [
"MIT"
] | null | null | null | docs/conf.py | ChattanoogaPublicLibrary/booksforcha | 1d4106acde35e3374b4a42ecb60798fcd279752e | [
"MIT"
] | 2 | 2015-03-31T14:07:15.000Z | 2015-04-01T03:08:39.000Z | docs/conf.py | ChattanoogaPublicLibrary/booksforcha | 1d4106acde35e3374b4a42ecb60798fcd279752e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# booksforcha documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
#... | 30.59058 | 76 | 0.715978 |
import sys
import os
cwd = os.getcwd()
project_root = os.path.dirname(cwd)
sys.path.insert(0, project_root)
import booksforcha
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'Books For CHA'
copyright = u'2015... | true | true |
f74d1f26b8f51907e5dc6cf864218245094285c1 | 4,058 | py | Python | python/data_sutram/scraper/appl_map.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/data_sutram/scraper/appl_map.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/data_sutram/scraper/appl_map.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | """
https://sat-cdn1.apple-mapkit.com/tile?style=7&size=1&scale=1&z=19&x=84135&y=202065&v=4002&accessKey=1549129912_6641142575737855346_%2F_9%2F4MX0U5yhJDc3LDXazhcQj3xjCJU%2BYsiKcviN%2FnWxE%3D&emphasis=standard&tint=dark
https://sat-cdn4.apple-mapkit.com/tile?style=7&size=1&scale=1&z=19&x=84135&y=202061&v=4002&accessK... | 47.186047 | 283 | 0.716116 | import urllib.request, urllib.parse, urllib.error
from bs4 import BeautifulSoup
import ssl
import os
import wget
import imghdr
import numpy as np
import requests
import time
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
import math
PI = math.pi
cdn = [1,2,3,4]
headers = {... | true | true |
f74d1f7442473997245ac683b8a269a3574d1ba4 | 2,678 | py | Python | crabageprediction/venv/Lib/site-packages/dateutil/easter.py | 13rianlucero/CrabAgePrediction | 92bc7fbe1040f49e820473e33cc3902a5a7177c7 | [
"MIT"
] | 18,636 | 2017-12-06T14:53:18.000Z | 2022-03-31T13:12:34.000Z | crabageprediction/venv/Lib/site-packages/dateutil/easter.py | 13rianlucero/CrabAgePrediction | 92bc7fbe1040f49e820473e33cc3902a5a7177c7 | [
"MIT"
] | 3,640 | 2017-12-06T16:58:35.000Z | 2022-03-31T22:20:57.000Z | crabageprediction/venv/Lib/site-packages/dateutil/easter.py | 13rianlucero/CrabAgePrediction | 92bc7fbe1040f49e820473e33cc3902a5a7177c7 | [
"MIT"
] | 1,987 | 2017-12-06T15:04:51.000Z | 2022-03-26T10:05:15.000Z | # -*- coding: utf-8 -*-
"""
This module offers a generic Easter computing method for any given year, using
Western, Orthodox or Julian algorithms.
"""
import datetime
__all__ = ["easter", "EASTER_JULIAN", "EASTER_ORTHODOX", "EASTER_WESTERN"]
EASTER_JULIAN = 1
EASTER_ORTHODOX = 2
EASTER_WESTERN = 3
def easter(year,... | 29.755556 | 79 | 0.587379 |
import datetime
__all__ = ["easter", "EASTER_JULIAN", "EASTER_ORTHODOX", "EASTER_WESTERN"]
EASTER_JULIAN = 1
EASTER_ORTHODOX = 2
EASTER_WESTERN = 3
def easter(year, method=EASTER_WESTERN):
if not (1 <= method <= 3):
raise ValueError("invalid method")
y = year
... | true | true |
f74d1f946e05a3c20906cb4194482f4391feedf8 | 3,733 | py | Python | scripts/validate_solutions.py | storyteller-aditya/hackathons | 008ba6bdd22e61c19eaec2426a48cf11a65eb9b0 | [
"CC-BY-4.0"
] | null | null | null | scripts/validate_solutions.py | storyteller-aditya/hackathons | 008ba6bdd22e61c19eaec2426a48cf11a65eb9b0 | [
"CC-BY-4.0"
] | null | null | null | scripts/validate_solutions.py | storyteller-aditya/hackathons | 008ba6bdd22e61c19eaec2426a48cf11a65eb9b0 | [
"CC-BY-4.0"
] | null | null | null | import argparse
import errno
import importlib
import logging
import os
import typing
from components import CheckSolver
logging.basicConfig(
format='%(asctime)s - %(message)s',
datefmt='%d-%b-%y %H:%M:%S',
level=logging.INFO
)
LOGGER = logging.getLogger()
SOLUTIONS_DIR = os.environ["SOLUTIONS_DIR"]
ATTRIBUTES... | 28.280303 | 73 | 0.753549 | import argparse
import errno
import importlib
import logging
import os
import typing
from components import CheckSolver
logging.basicConfig(
format='%(asctime)s - %(message)s',
datefmt='%d-%b-%y %H:%M:%S',
level=logging.INFO
)
LOGGER = logging.getLogger()
SOLUTIONS_DIR = os.environ["SOLUTIONS_DIR"]
ATTRIBUTES... | true | true |
f74d20fc89b8933a128bc9033164cfc838b20857 | 81 | py | Python | add/apps.py | thcoffee/aom2 | d5c45b9905d10906ba14c23f2cf6d29f9b90f60a | [
"Apache-2.0"
] | 2 | 2019-08-25T05:07:32.000Z | 2019-09-04T07:37:25.000Z | add/apps.py | thcoffee/aom2 | d5c45b9905d10906ba14c23f2cf6d29f9b90f60a | [
"Apache-2.0"
] | 1 | 2022-03-05T10:11:21.000Z | 2022-03-05T10:11:21.000Z | add/apps.py | thcoffee/aom2 | d5c45b9905d10906ba14c23f2cf6d29f9b90f60a | [
"Apache-2.0"
] | 1 | 2022-03-05T10:15:16.000Z | 2022-03-05T10:15:16.000Z | from django.apps import AppConfig
class AddConfig(AppConfig):
name = 'add'
| 13.5 | 33 | 0.728395 | from django.apps import AppConfig
class AddConfig(AppConfig):
name = 'add'
| true | true |
f74d21e06d8ab3916b257b5eaf790f3234bc964f | 1,550 | py | Python | tasks.py | edublancas/ploomber-workshop | 97a44bcda37557a9bee43c190c3383b7320575bb | [
"MIT"
] | 3 | 2021-10-30T13:45:56.000Z | 2021-12-11T19:55:14.000Z | tasks.py | edublancas/ploomber-workshop | 97a44bcda37557a9bee43c190c3383b7320575bb | [
"MIT"
] | 1 | 2021-08-16T23:41:52.000Z | 2021-08-16T23:41:52.000Z | tasks.py | edublancas/ploomber-workshop | 97a44bcda37557a9bee43c190c3383b7320575bb | [
"MIT"
] | 3 | 2021-08-16T23:37:34.000Z | 2021-09-18T19:58:09.000Z | from pathlib import Path
import shutil
from jinja2 import Template
from invoke import task
import jupytext
_TARGET = Path('~', 'dev', 'ploomber').expanduser()
@task
def setup(c, from_lock=False):
"""Create conda environment
"""
if from_lock:
c.run('conda env create --file environment.yml --force... | 24.603175 | 71 | 0.611613 | from pathlib import Path
import shutil
from jinja2 import Template
from invoke import task
import jupytext
_TARGET = Path('~', 'dev', 'ploomber').expanduser()
@task
def setup(c, from_lock=False):
if from_lock:
c.run('conda env create --file environment.yml --force')
else:
c.run('conda env cr... | true | true |
f74d2268a0f52ae41d64492c8f0c1a34575d979d | 199,854 | py | Python | openemory/publication/tests.py | emory-libraries/OpenEmory | 8342ff600cb8d0fa07a55840e199533388490ea3 | [
"Apache-2.0"
] | null | null | null | openemory/publication/tests.py | emory-libraries/OpenEmory | 8342ff600cb8d0fa07a55840e199533388490ea3 | [
"Apache-2.0"
] | 19 | 2016-04-26T20:29:55.000Z | 2019-10-17T19:01:55.000Z | openemory/publication/tests.py | emory-libraries/OpenEmory | 8342ff600cb8d0fa07a55840e199533388490ea3 | [
"Apache-2.0"
] | 1 | 2015-08-11T10:35:44.000Z | 2015-08-11T10:35:44.000Z | # file openemory/publication/tests.py
#
# Copyright 2010 Emory University General Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICE... | 49.48106 | 207 | 0.633377 |
import sys
from contextlib import contextmanager
import datetime
import json
import logging
import os
import sunburnt
from slugify import slugify
from eulfedora.rdfns import model as relsextns
from cStringIO import StringIO
from datetime import date
from dateutil.relativedelta import relativedelta
from django.conf imp... | false | true |
f74d247f1bc8154ca58c63a262a25033e6f687a5 | 4,996 | py | Python | tests/unit_tests/test_exchange_coinbase.py | Joel-max-s/pycryptobot | 58936a117ae0586304041cec10820545d41efa34 | [
"Apache-2.0"
] | 1,447 | 2021-01-04T08:08:37.000Z | 2022-03-26T12:28:36.000Z | tests/unit_tests/test_exchange_coinbase.py | joa-rodrigues/pycryptobot | 669f4a3c73eb0ac85f9e4261a093fd61c38ca7ab | [
"Apache-2.0"
] | 434 | 2021-02-07T23:42:59.000Z | 2022-03-31T11:14:14.000Z | tests/unit_tests/test_exchange_coinbase.py | joa-rodrigues/pycryptobot | 669f4a3c73eb0ac85f9e4261a093fd61c38ca7ab | [
"Apache-2.0"
] | 577 | 2020-12-17T17:13:40.000Z | 2022-03-31T07:04:52.000Z | import json
import pytest
import responses
import requests
import sys
import pandas
from models.exchange.ExchangesEnum import Exchange
sys.path.append('.')
# pylint: disable=import-error
from models.PyCryptoBot import PyCryptoBot
from models.exchange.coinbase_pro import AuthAPI, PublicAPI
app = PyCryptoBot(exchange=... | 32.653595 | 132 | 0.70036 | import json
import pytest
import responses
import requests
import sys
import pandas
from models.exchange.ExchangesEnum import Exchange
sys.path.append('.')
from models.PyCryptoBot import PyCryptoBot
from models.exchange.coinbase_pro import AuthAPI, PublicAPI
app = PyCryptoBot(exchange= Exchange.COINBASEPRO)
def tes... | true | true |
f74d29149debcf1a0775297543cc5ed53ec37037 | 4,592 | py | Python | c2cgeoportal/tests/functional/test_shortener.py | craxxkid/c2cgeoportal | 60ca7d5d014d69b0a938f858271c911a30da77c3 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | c2cgeoportal/tests/functional/test_shortener.py | craxxkid/c2cgeoportal | 60ca7d5d014d69b0a938f858271c911a30da77c3 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | c2cgeoportal/tests/functional/test_shortener.py | craxxkid/c2cgeoportal | 60ca7d5d014d69b0a938f858271c911a30da77c3 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2013-2016, Camptocamp SA
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, this
#... | 34.787879 | 81 | 0.660497 |
from unittest import TestCase
from nose.plugins.attrib import attr
from pyramid import testing
from c2cgeoportal.tests.functional import ( tear_down_common as tearDownModule, set_up_common as setUpModule
)
@attr(functional=True)
class TestshortenerView(TestCase):
def setUp(self): pass
... | true | true |
f74d2a9f31f4631925debf1f5c5086b3b13e7f88 | 4,153 | py | Python | python-cookie-cutter/lib/python_cookie_cutter/projectbuilder.py | sirmax666/python-cookie-cutter | 22f6dd50736dec59ec3266ff31c4d44a0787c14c | [
"MIT"
] | null | null | null | python-cookie-cutter/lib/python_cookie_cutter/projectbuilder.py | sirmax666/python-cookie-cutter | 22f6dd50736dec59ec3266ff31c4d44a0787c14c | [
"MIT"
] | null | null | null | python-cookie-cutter/lib/python_cookie_cutter/projectbuilder.py | sirmax666/python-cookie-cutter | 22f6dd50736dec59ec3266ff31c4d44a0787c14c | [
"MIT"
] | null | null | null | # -----------------------------------------------------------------------------
# Builder
# -----------------------------------------------------------------------------
# Team: DataHub
# -----------------------------------------------------------------------------
# Author: Maxime Sirois
# ----------------------... | 36.113043 | 80 | 0.554057 |
from jinja2 import Template
import logging
from pathlib import Path
import subprocess
from . import constants as C
from . import utils
logger = logging.getLogger(__name__)
class Builder:
def __init__(self, properties, parameters=None):
self.parameters = parameters
self.proper... | true | true |
f74d2adc2823f9d8a4ba4829012cc9b39cb3fbaa | 334 | py | Python | tests/python-gpu/test_gpu_demos.py | sanchitanand/xgboost | b3193052b31e3e984f0f3d9c2c67ae3c2e114f9b | [
"Apache-2.0"
] | 2 | 2020-12-28T06:19:42.000Z | 2021-11-20T04:36:08.000Z | tests/python-gpu/test_gpu_demos.py | sanchitanand/xgboost | b3193052b31e3e984f0f3d9c2c67ae3c2e114f9b | [
"Apache-2.0"
] | 1 | 2020-07-20T17:18:36.000Z | 2020-07-20T17:18:36.000Z | tests/python-gpu/test_gpu_demos.py | sanchitanand/xgboost | b3193052b31e3e984f0f3d9c2c67ae3c2e114f9b | [
"Apache-2.0"
] | 1 | 2019-07-21T03:12:42.000Z | 2019-07-21T03:12:42.000Z | import os
import subprocess
import sys
import pytest
sys.path.append("tests/python")
import testing as tm
import test_demos as td # noqa
@pytest.mark.skipif(**tm.no_cupy())
def test_data_iterator():
script = os.path.join(td.PYTHON_DEMO_DIR, 'data_iterator.py')
cmd = ['python', script]
subprocess.ch... | 23.857143 | 65 | 0.724551 | import os
import subprocess
import sys
import pytest
sys.path.append("tests/python")
import testing as tm
import test_demos as td
@pytest.mark.skipif(**tm.no_cupy())
def test_data_iterator():
script = os.path.join(td.PYTHON_DEMO_DIR, 'data_iterator.py')
cmd = ['python', script]
subprocess.check_cal... | true | true |
f74d2b99d70a70ac36210e105d7657a35800c6fb | 1,192 | py | Python | dmarc_metrics_exporter/tests/test_metrics_persister.py | Tristan971/dmarc-metrics-exporter | d666693786fdd75b95cf8f13738bf177e70d741b | [
"MIT"
] | 6 | 2021-09-17T20:15:30.000Z | 2022-02-26T18:14:17.000Z | dmarc_metrics_exporter/tests/test_metrics_persister.py | Tristan971/dmarc-metrics-exporter | d666693786fdd75b95cf8f13738bf177e70d741b | [
"MIT"
] | 14 | 2021-01-11T13:24:18.000Z | 2022-02-09T20:43:51.000Z | dmarc_metrics_exporter/tests/test_metrics_persister.py | fl42/dmarc-metrics-exporter | 59a5825016e0bdfeeefcb25d39c4a01218daf9d4 | [
"MIT"
] | 4 | 2021-09-20T14:53:49.000Z | 2021-12-17T18:49:45.000Z | from dmarc_metrics_exporter.dmarc_metrics import (
Disposition,
DmarcMetrics,
DmarcMetricsCollection,
Meta,
)
from dmarc_metrics_exporter.metrics_persister import MetricsPersister
def test_roundtrip_metrics(tmp_path):
metrics_db = tmp_path / "metrics.db"
metrics = DmarcMetricsCollection(
... | 29.8 | 75 | 0.627517 | from dmarc_metrics_exporter.dmarc_metrics import (
Disposition,
DmarcMetrics,
DmarcMetricsCollection,
Meta,
)
from dmarc_metrics_exporter.metrics_persister import MetricsPersister
def test_roundtrip_metrics(tmp_path):
metrics_db = tmp_path / "metrics.db"
metrics = DmarcMetricsCollection(
... | true | true |
f74d2cb20e1ea6030aaa7c62c38404d8a5b803a1 | 2,099 | py | Python | src/indra_cogex/sources/bgee/__init__.py | dianakolusheva/indra_cogex | d149c6d4b7ffa5fb939badcc61684e016666153b | [
"BSD-2-Clause"
] | 2 | 2021-05-27T02:44:09.000Z | 2022-01-12T21:34:07.000Z | src/indra_cogex/sources/bgee/__init__.py | dianakolusheva/indra_cogex | d149c6d4b7ffa5fb939badcc61684e016666153b | [
"BSD-2-Clause"
] | 33 | 2021-08-29T18:23:26.000Z | 2022-03-29T21:56:08.000Z | src/indra_cogex/sources/bgee/__init__.py | dianakolusheva/indra_cogex | d149c6d4b7ffa5fb939badcc61684e016666153b | [
"BSD-2-Clause"
] | 5 | 2021-06-15T09:01:23.000Z | 2022-03-13T14:26:09.000Z | # -*- coding: utf-8 -*-
"""Processor for Bgee."""
import os
import pickle
from pathlib import Path
from typing import Union
import pyobo
from indra_cogex.representation import Node, Relation
from indra_cogex.sources.processor import Processor
class BgeeProcessor(Processor):
"""Processor for Bgee."""
name... | 30.42029 | 104 | 0.580753 |
import os
import pickle
from pathlib import Path
from typing import Union
import pyobo
from indra_cogex.representation import Node, Relation
from indra_cogex.sources.processor import Processor
class BgeeProcessor(Processor):
name = "bgee"
node_types = ["BioEntity"]
def __init__(self, path: Union[Non... | true | true |
f74d2ccd36714d8c8feb1fa3fdbdedb0c184a37b | 429 | py | Python | hstphot/read_ds9region.py | bkornpob/hstphot | eafaebc382450061690c5795ce350336801d8037 | [
"MIT"
] | null | null | null | hstphot/read_ds9region.py | bkornpob/hstphot | eafaebc382450061690c5795ce350336801d8037 | [
"MIT"
] | null | null | null | hstphot/read_ds9region.py | bkornpob/hstphot | eafaebc382450061690c5795ce350336801d8037 | [
"MIT"
] | null | null | null | import numpy as np
def read_ds9region(ds9regfile):
"""
Assume ds9regfile in the format as ds9, and coordinate system as image
"""
out = {}
f = open(ds9regfile,'r')
for i,ii in enumerate(f.readlines()):
if i < 3:
continue
x,y,_ = np.array(ii.split('(')[1].split(')')[0... | 26.8125 | 81 | 0.531469 | import numpy as np
def read_ds9region(ds9regfile):
out = {}
f = open(ds9regfile,'r')
for i,ii in enumerate(f.readlines()):
if i < 3:
continue
x,y,_ = np.array(ii.split('(')[1].split(')')[0].split(',')).astype(float)
z = ii.split('{')[1].split('}')[0]
out[z] = (x,... | true | true |
f74d2f9a511f3627930afd668bc222d2a2aa3261 | 2,587 | py | Python | app/core/models.py | ijhajj/recipe-app-api | dbce67aa89b0718e900ac0aa113197cde6b94b42 | [
"MIT"
] | null | null | null | app/core/models.py | ijhajj/recipe-app-api | dbce67aa89b0718e900ac0aa113197cde6b94b42 | [
"MIT"
] | null | null | null | app/core/models.py | ijhajj/recipe-app-api | dbce67aa89b0718e900ac0aa113197cde6b94b42 | [
"MIT"
] | null | null | null | import uuid
import os
from django.db import models
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, \
PermissionsMixin
from django.conf import settings
def recipe_image_file_path(instance, filename):
"""Generate file path for new recipe image"""
... | 28.744444 | 76 | 0.669115 | import uuid
import os
from django.db import models
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, \
PermissionsMixin
from django.conf import settings
def recipe_image_file_path(instance, filename):
ext = filename.split('.')[-1]
filename = f'{u... | true | true |
f74d31672bd7fcacc80c39737d4007abb3ffca90 | 11,674 | py | Python | config/settings/base.py | dhavalsavalia/techfest_management | 651b13277243b861f1c492d56122d32de2a7858a | [
"Apache-1.1"
] | 2 | 2019-02-22T18:59:58.000Z | 2021-09-21T16:14:46.000Z | config/settings/base.py | dhavalsavalia/techfest_management | 651b13277243b861f1c492d56122d32de2a7858a | [
"Apache-1.1"
] | null | null | null | config/settings/base.py | dhavalsavalia/techfest_management | 651b13277243b861f1c492d56122d32de2a7858a | [
"Apache-1.1"
] | null | null | null | """
Base settings to build other settings files upon.
"""
import environ
ROOT_DIR = environ.Path(__file__) - 3 # (techfest_management/config/settings/base.py - 3 = techfest_management/)
APPS_DIR = ROOT_DIR.path('techfest_management')
env = environ.Env()
READ_DOT_ENV_FILE = env.bool('DJANGO_READ_DOT_ENV_FILE', defa... | 41.992806 | 113 | 0.647165 |
import environ
ROOT_DIR = environ.Path(__file__) - 3 APPS_DIR = ROOT_DIR.path('techfest_management')
env = environ.Env()
READ_DOT_ENV_FILE = env.bool('DJANGO_READ_DOT_ENV_FILE', default=False)
if READ_DOT_ENV_FILE:
env.read_env(str(ROOT_DIR.path('.env')))
DEBUG = env.bool('DJANGO_DEBUG', False)
TIME_ZONE ... | true | true |
f74d31c48ab23326ffe95c058bb72dde1546c508 | 114 | py | Python | todo/backend/todos/admin.py | XrossFox/DjangoForAPIsCodeExamples | e4d02533a2fba6dad24044816558f69f053b341c | [
"MIT"
] | null | null | null | todo/backend/todos/admin.py | XrossFox/DjangoForAPIsCodeExamples | e4d02533a2fba6dad24044816558f69f053b341c | [
"MIT"
] | 1 | 2018-11-20T13:55:12.000Z | 2018-11-20T13:55:12.000Z | todo/backend/todos/admin.py | hannody/todo-api-react | 89869f7c86a88634c989512cf346ed5ca1f46259 | [
"MIT"
] | null | null | null | from django.contrib import admin
# Register your models here.
from .models import Todo
admin.site.register(Todo)
| 19 | 32 | 0.798246 | from django.contrib import admin
from .models import Todo
admin.site.register(Todo)
| true | true |
f74d31d75ae2ba84ae77be864aed71356c28fe66 | 8,256 | py | Python | ttt/board.py | codacy-badger/nxn-tic-tac-toe | 15784200cb0ff067bbcc1e31171a458f12de276a | [
"MIT"
] | null | null | null | ttt/board.py | codacy-badger/nxn-tic-tac-toe | 15784200cb0ff067bbcc1e31171a458f12de276a | [
"MIT"
] | null | null | null | ttt/board.py | codacy-badger/nxn-tic-tac-toe | 15784200cb0ff067bbcc1e31171a458f12de276a | [
"MIT"
] | null | null | null | from typing import List, Dict
from ttt.helper_util import (PositionOccupiedException,
InvalidCellPosition, AllMovesExhausedWithNoWinner,
BgColors)
from ttt.player import Player
class Move(object):
"""
Class used to identify a move being selected by th... | 35.131915 | 86 | 0.58188 | from typing import List, Dict
from ttt.helper_util import (PositionOccupiedException,
InvalidCellPosition, AllMovesExhausedWithNoWinner,
BgColors)
from ttt.player import Player
class Move(object):
def __init__(self, position: int):
self._position... | true | true |
f74d32d1ef804916556b035fe66052485a4b75a8 | 33 | py | Python | runserver.py | kjnsn/mhvdb2 | ce3fc77f76ca32e2aaeff928b291cc45d041b68f | [
"MIT"
] | 2 | 2015-04-11T09:45:41.000Z | 2015-06-16T03:59:48.000Z | runserver.py | kjnsn/mhvdb2 | ce3fc77f76ca32e2aaeff928b291cc45d041b68f | [
"MIT"
] | 32 | 2015-01-27T05:39:41.000Z | 2019-11-10T09:57:27.000Z | runserver.py | kjnsn/mhvdb2 | ce3fc77f76ca32e2aaeff928b291cc45d041b68f | [
"MIT"
] | 2 | 2015-04-11T09:38:46.000Z | 2015-04-14T08:01:49.000Z | from mhvdb2 import app
app.run()
| 11 | 22 | 0.757576 | from mhvdb2 import app
app.run()
| true | true |
f74d32e9405d5223643140109d54267e60d58480 | 6,850 | py | Python | examples/dmri_dtk_dti.py | FredLoney/nipype | ceaa28dcbfe29ca4373479c897da9fc958167ccd | [
"BSD-3-Clause"
] | 1 | 2018-09-09T14:47:04.000Z | 2018-09-09T14:47:04.000Z | examples/dmri_dtk_dti.py | MarcCote/nipype | b4014e1d87509f35242f0547f51d2b8962f83cbe | [
"BSD-3-Clause"
] | null | null | null | examples/dmri_dtk_dti.py | MarcCote/nipype | b4014e1d87509f35242f0547f51d2b8962f83cbe | [
"BSD-3-Clause"
] | 1 | 2020-02-19T13:47:05.000Z | 2020-02-19T13:47:05.000Z | #!/usr/bin/env python
"""
==================================
dMRI: DTI - Diffusion Toolkit, FSL
==================================
A pipeline example that uses several interfaces to perform analysis on
diffusion weighted images using Diffusion Toolkit tools.
This tutorial is based on the 2010 FSL course and uses data... | 31.422018 | 97 | 0.661606 |
import nipype.interfaces.io as nio import nipype.interfaces.fsl as fsl import nipype.interfaces.diffusion_toolkit as dtk
import nipype.interfaces.utility as util import nipype.pipeline.engine as pe import os from nipype.workflows.dmri.fsl.dti import cr... | true | true |
f74d33791ddbc5adc0909b31a58953af26d1307d | 5,067 | py | Python | streamlit_app/streamlit_app.py | gerardrbentley/peak-weather | 2880184c99c2d30075665f76a9e8b815906a55e5 | [
"Apache-2.0"
] | null | null | null | streamlit_app/streamlit_app.py | gerardrbentley/peak-weather | 2880184c99c2d30075665f76a9e8b815906a55e5 | [
"Apache-2.0"
] | null | null | null | streamlit_app/streamlit_app.py | gerardrbentley/peak-weather | 2880184c99c2d30075665f76a9e8b815906a55e5 | [
"Apache-2.0"
] | null | null | null | from copy import deepcopy
import asyncio
import json
import pandas as pd
import streamlit as st
from structlog import get_logger
from helpers import (
fromtimestamp,
show_weather,
WeatherItem,
gather_one_call_weather_data,
clean_time,
)
log = get_logger()
st.set_page_config(
layout="wide",
... | 33.117647 | 109 | 0.612197 | from copy import deepcopy
import asyncio
import json
import pandas as pd
import streamlit as st
from structlog import get_logger
from helpers import (
fromtimestamp,
show_weather,
WeatherItem,
gather_one_call_weather_data,
clean_time,
)
log = get_logger()
st.set_page_config(
layout="wide",
... | true | true |
f74d340365398ccec15f787f0ea1692c1384e107 | 16,004 | py | Python | datadog_automon.py | looprock/automon | 333d8b28843e687d499ea00d1bf4c6f2b6334b59 | [
"Apache-2.0"
] | null | null | null | datadog_automon.py | looprock/automon | 333d8b28843e687d499ea00d1bf4c6f2b6334b59 | [
"Apache-2.0"
] | null | null | null | datadog_automon.py | looprock/automon | 333d8b28843e687d499ea00d1bf4c6f2b6334b59 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import argparse
import logging
import sys
import os
import re
import yaml
from jinja2 import Template, Environment, FileSystemLoader
# Goals:
# k8s_container_cpu_exceeding_request: CPU exceeds request over 10 minutes - if cpu request configured
# k8s_container_memory_exceeding_request: Memory exc... | 42.338624 | 218 | 0.663147 | import argparse
import logging
import sys
import os
import re
import yaml
from jinja2 import Template, Environment, FileSystemLoader
debug = os.environ.get('DEBUG', None)
if debug:
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
else:
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
if... | true | true |
f74d3431a049864969eafcbd08bb28da4ee82a26 | 6,205 | py | Python | simulation/acc_idmplus.py | ErwindeGelder/ScenarioRiskQuantification | ee351b7bd3629af0c1d1d800dcc5ac5426b9b804 | [
"MIT"
] | 4 | 2021-06-28T07:33:27.000Z | 2022-02-20T09:26:41.000Z | simulation/acc_idmplus.py | ErwindeGelder/ScenarioRiskQuantification | ee351b7bd3629af0c1d1d800dcc5ac5426b9b804 | [
"MIT"
] | null | null | null | simulation/acc_idmplus.py | ErwindeGelder/ScenarioRiskQuantification | ee351b7bd3629af0c1d1d800dcc5ac5426b9b804 | [
"MIT"
] | null | null | null | """ Model of ACC with FCW and IDM+ to take over from Xiao et al. (2017).
Creation date: 2020 08 12
Author(s): Erwin de Gelder
Modifications:
"""
import numpy as np
from .acc import ACC, ACCParameters, ACCState
from .idm import IDMParameters
from .idmplus import IDMPlus
class ACCIDMPlusParameters(ACCParameters):
... | 43.090278 | 100 | 0.654956 |
import numpy as np
from .acc import ACC, ACCParameters, ACCState
from .idm import IDMParameters
from .idmplus import IDMPlus
class ACCIDMPlusParameters(ACCParameters):
fcw_threshold: float = 0.75 fcw_delay: float = 1.0 driver_takeover_speed: float = 15.0 driver_takeover_view: float = 150 driv... | true | true |
f74d3584214912f584b1e49a3447c52fd2c46b3b | 32,861 | py | Python | addons/odoo/addons/stock/models/stock_rule.py | apadanagroup/parOdoo | 8c6f67848e0689b76fb780feca08d819fd3c1847 | [
"Apache-2.0"
] | 12 | 2021-03-26T08:39:40.000Z | 2022-03-16T02:20:10.000Z | addons/odoo/addons/stock/models/stock_rule.py | apadanagroup/parOdoo | 8c6f67848e0689b76fb780feca08d819fd3c1847 | [
"Apache-2.0"
] | 13 | 2020-12-20T16:00:21.000Z | 2022-03-14T14:55:30.000Z | addons/odoo/addons/stock/models/stock_rule.py | apadanagroup/parOdoo | 8c6f67848e0689b76fb780feca08d819fd3c1847 | [
"Apache-2.0"
] | 17 | 2020-08-31T11:18:49.000Z | 2022-02-09T05:57:31.000Z | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from collections import namedtuple, OrderedDict, defaultdict
from dateutil.relativedelta import relativedelta
from odoo.tools.misc import split_every
from psycopg2 import OperationalError
from odoo import api, fields, m... | 52.160317 | 184 | 0.629835 |
from collections import namedtuple, OrderedDict, defaultdict
from dateutil.relativedelta import relativedelta
from odoo.tools.misc import split_every
from psycopg2 import OperationalError
from odoo import api, fields, models, registry, SUPERUSER_ID, _
from odoo.osv import expression
from odoo.tools import DEFAULT_SER... | true | true |
f74d3719939013bef66b6d791bc59048a670c2fc | 146 | py | Python | Projeto Django/contato/apps.py | yurimses/tp-cruzi-db | 201c114b70c7dc3b7eaf549d1778689567499e22 | [
"MIT"
] | 1 | 2021-03-26T18:21:59.000Z | 2021-03-26T18:21:59.000Z | Projeto Django/contato/apps.py | yurimses/tp-cruzi-db | 201c114b70c7dc3b7eaf549d1778689567499e22 | [
"MIT"
] | 14 | 2021-03-26T20:54:22.000Z | 2021-04-06T17:18:53.000Z | Projeto Django/contato/apps.py | yurimses/tp-cruzi-db | 201c114b70c7dc3b7eaf549d1778689567499e22 | [
"MIT"
] | 2 | 2021-04-01T23:43:20.000Z | 2021-04-27T13:35:28.000Z | from django.apps import AppConfig
class ContatoConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'contato'
| 20.857143 | 56 | 0.760274 | from django.apps import AppConfig
class ContatoConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'contato'
| true | true |
f74d376556e1a4481299787149e535d6ac958aae | 5,125 | py | Python | pinn/models/base.py | yqshao/PiNN | a0ab812acfd799e4da0f4b283e63ea2f559c4151 | [
"BSD-3-Clause"
] | 3 | 2019-10-11T02:31:16.000Z | 2022-03-12T04:48:48.000Z | pinn/models/base.py | yqshao/pinn | 464034dda44ce053cf1255a3e7d367c636d6b9f3 | [
"BSD-3-Clause"
] | null | null | null | pinn/models/base.py | yqshao/pinn | 464034dda44ce053cf1255a3e7d367c636d6b9f3 | [
"BSD-3-Clause"
] | 1 | 2021-07-02T19:31:01.000Z | 2021-07-02T19:31:01.000Z | # -*- coding: utf-8 -*-
"""Basic functions for PiNN models"""
import tensorflow as tf
from pinn.utils import pi_named
def export_model(model_fn):
# default parameters for all models
from pinn.optimizers import default_adam
default_params = {'optimizer': default_adam}
def pinn_model(params, **kwargs):
... | 43.432203 | 110 | 0.59922 | import tensorflow as tf
from pinn.utils import pi_named
def export_model(model_fn):
from pinn.optimizers import default_adam
default_params = {'optimizer': default_adam}
def pinn_model(params, **kwargs):
model_dir = params['model_dir']
params_tmp = default_params.copy()
params_t... | true | true |
f74d37b31148b688616cf054a7531d0d598930a2 | 553 | py | Python | Python_ABC/2-12excel/4updateProduce.py | Chandler-Song/Python_Awesome | a44b8b79de7b429a00ac5798e7ecdc26c79a09ed | [
"MIT"
] | null | null | null | Python_ABC/2-12excel/4updateProduce.py | Chandler-Song/Python_Awesome | a44b8b79de7b429a00ac5798e7ecdc26c79a09ed | [
"MIT"
] | null | null | null | Python_ABC/2-12excel/4updateProduce.py | Chandler-Song/Python_Awesome | a44b8b79de7b429a00ac5798e7ecdc26c79a09ed | [
"MIT"
] | null | null | null | # Corret cost in produceSale spreadsheet
import openpyxl
# The product types and their updated prices
PRICE_UPDATE = {
'Garlic': 3.17,
'Celery':1.19,
'Lemon': 1.27
}
wb = openpyxl.load_workbook('produceSales.xlsx')
ws = wb.get_sheet_by_name('Sheet')
# loop through the rows and update the prices, skip the fi... | 25.136364 | 65 | 0.737794 | import openpyxl
PRICE_UPDATE = {
'Garlic': 3.17,
'Celery':1.19,
'Lemon': 1.27
}
wb = openpyxl.load_workbook('produceSales.xlsx')
ws = wb.get_sheet_by_name('Sheet')
for rowNum in range(2, ws.max_row+1):
productName = ws.cell(row=rowNum, column=1).value
if productName in PRICE_UPDATE:
ws.cell(row=rowNum... | true | true |
f74d38be5f92a764f9105c28efe0d3c0263e2c28 | 9,601 | py | Python | Packs/Cybereason/Integrations/Cybereason/Cybereason_test.py | ddi-danielsantander/content | 67e2edc404f50c332d928dbdbce00a447bb5532f | [
"MIT"
] | 1 | 2020-04-19T11:05:42.000Z | 2020-04-19T11:05:42.000Z | Packs/Cybereason/Integrations/Cybereason/Cybereason_test.py | ddi-danielsantander/content | 67e2edc404f50c332d928dbdbce00a447bb5532f | [
"MIT"
] | 9 | 2021-02-08T20:51:18.000Z | 2021-09-23T23:27:38.000Z | Packs/Cybereason/Integrations/Cybereason/Cybereason_test.py | ddi-danielsantander/content | 67e2edc404f50c332d928dbdbce00a447bb5532f | [
"MIT"
] | 2 | 2020-10-11T18:01:32.000Z | 2020-10-14T03:21:23.000Z | import demistomock as demisto
""" API RAW RESULTS """
MACHINE_OUTPUTS = {
"status": "SUCCESS",
"message": "",
"data": {
"evidenceMap": {
"reportedByAntiMalwareEvidence": 1
},
"resultIdToElementDataMap": {
"-1879720569.-2277552225461983666": {
... | 36.505703 | 130 | 0.373399 | import demistomock as demisto
MACHINE_OUTPUTS = {
"status": "SUCCESS",
"message": "",
"data": {
"evidenceMap": {
"reportedByAntiMalwareEvidence": 1
},
"resultIdToElementDataMap": {
"-1879720569.-2277552225461983666": {
"isMalicious": 'false'... | true | true |
f74d38e5765d811c6e031d0e84273a595a6ace74 | 7,114 | py | Python | glimslib/simulation_helpers/test_unit_timeSeriesMultiData.py | danielabler/glimslib | 3d345bf3ed2d364e83a00ad9297dd5f81d7193db | [
"MIT"
] | null | null | null | glimslib/simulation_helpers/test_unit_timeSeriesMultiData.py | danielabler/glimslib | 3d345bf3ed2d364e83a00ad9297dd5f81d7193db | [
"MIT"
] | 5 | 2019-01-05T01:38:05.000Z | 2019-06-03T16:49:27.000Z | glimslib/simulation_helpers/test_unit_timeSeriesMultiData.py | danielabler/glimslib | 3d345bf3ed2d364e83a00ad9297dd5f81d7193db | [
"MIT"
] | 3 | 2019-12-28T16:01:48.000Z | 2022-01-20T08:44:01.000Z | from unittest import TestCase
import os
import numpy as np
import glimslib.utils.file_utils as fu
from glimslib import fenics_local as fenics, config
from glimslib.simulation_helpers.helper_classes import FunctionSpace, TimeSeriesMultiData
class TestTimeSeriesMultiData(TestCase):
def setUp(self):
# Doma... | 56.460317 | 112 | 0.702277 | from unittest import TestCase
import os
import numpy as np
import glimslib.utils.file_utils as fu
from glimslib import fenics_local as fenics, config
from glimslib.simulation_helpers.helper_classes import FunctionSpace, TimeSeriesMultiData
class TestTimeSeriesMultiData(TestCase):
def setUp(self):
... | true | true |
f74d39490a295f86abcf8a65d2eac67cd6edc176 | 3,849 | py | Python | devscripts/create-github-release.py | galgamerslee/youtobedl | 7b0d1c28597bd38567e5b4e853f669a5a601c6e8 | [
"Unlicense"
] | 10 | 2020-05-29T03:20:03.000Z | 2022-03-29T01:05:20.000Z | devscripts/create-github-release.py | huyangfeng/youtobedl | 7b0d1c28597bd38567e5b4e853f669a5a601c6e8 | [
"Unlicense"
] | null | null | null | devscripts/create-github-release.py | huyangfeng/youtobedl | 7b0d1c28597bd38567e5b4e853f669a5a601c6e8 | [
"Unlicense"
] | 9 | 2020-05-29T03:21:02.000Z | 2021-04-14T03:26:05.000Z | #!/usr/bin/env python
from __future__ import unicode_literals
import base64
import json
import mimetypes
import netrc
import optparse
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from youtube_dl.compat import (
compat_basestring,
compat_input,
compa... | 34.061947 | 95 | 0.646402 | from __future__ import unicode_literals
import base64
import json
import mimetypes
import netrc
import optparse
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from youtube_dl.compat import (
compat_basestring,
compat_input,
compat_getpass,
compat_... | true | true |
f74d3a7e76e56b7f23c11637771b91bb4921a56b | 1,372 | py | Python | tools/nmeatk.py | dakk/nmeatoolkit | 6378d2aa6937732e8ad1c47ce7a9ad0f629f5351 | [
"MIT"
] | null | null | null | tools/nmeatk.py | dakk/nmeatoolkit | 6378d2aa6937732e8ad1c47ce7a9ad0f629f5351 | [
"MIT"
] | null | null | null | tools/nmeatk.py | dakk/nmeatoolkit | 6378d2aa6937732e8ad1c47ce7a9ad0f629f5351 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (C) 2021 Davide Gessa
'''
MIT License
Copyright (c) 2021 Davide Gessa
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 li... | 37.081081 | 78 | 0.774781 | from nmeatoolkit.args import getDefaultParser, processArguments
def main():
parser = getDefaultParser()
args = parser.parse_args()
pipeline = processArguments(args)
pipeline.run()
if __name__ == "__main__":
main() | true | true |
f74d3cd274286ba754528a104b66bb2d95b8bb53 | 2,782 | py | Python | stdimage/utils.py | timomeara/django-stdimage | c8635440cfd7209b86a321075f66e3b881450073 | [
"MIT"
] | null | null | null | stdimage/utils.py | timomeara/django-stdimage | c8635440cfd7209b86a321075f66e3b881450073 | [
"MIT"
] | null | null | null | stdimage/utils.py | timomeara/django-stdimage | c8635440cfd7209b86a321075f66e3b881450073 | [
"MIT"
] | null | null | null | import os
import uuid
from django.core.files.storage import default_storage
from django.utils.text import slugify
from .models import StdImageField, StdImageFieldFile
class UploadTo:
file_pattern = "%(name)s%(ext)s"
path_pattern = "%(path)s"
def __call__(self, instance, filename):
path, ext = o... | 29.284211 | 77 | 0.643781 | import os
import uuid
from django.core.files.storage import default_storage
from django.utils.text import slugify
from .models import StdImageField, StdImageFieldFile
class UploadTo:
file_pattern = "%(name)s%(ext)s"
path_pattern = "%(path)s"
def __call__(self, instance, filename):
path, ext = o... | true | true |
f74d3cd803994be5b0ec6f093a396dab53fd0640 | 2,594 | py | Python | f_d_c.py | ashu2004a/face_recognition | a0585d81daa7f0588e6269df8e26fdf7f18c27be | [
"CC0-1.0"
] | 1 | 2021-04-25T14:48:23.000Z | 2021-04-25T14:48:23.000Z | f_d_c.py | ashu2004a/face_recognition | a0585d81daa7f0588e6269df8e26fdf7f18c27be | [
"CC0-1.0"
] | null | null | null | f_d_c.py | ashu2004a/face_recognition | a0585d81daa7f0588e6269df8e26fdf7f18c27be | [
"CC0-1.0"
] | null | null | null | '''
Author: Ashutosh Panigrahi
Year: 2021
Version: 0.0.1
'''
#This piece of code detect the face (image in png/jpg or else given) given.
import __future__
import click
import os
import re
import face_recognition.api as fcrec
import multiprocessing
import sys
import itertools
def print_result(filename, location):
... | 32.835443 | 137 | 0.712799 |
import __future__
import click
import os
import re
import face_recognition.api as fcrec
import multiprocessing
import sys
import itertools
def print_result(filename, location):
top, right, bottom, left = location
print("{},{},{},{},{}".format(filename, top, right, bottom, left))
def test_image(image_to_ch... | true | true |
f74d3d5926733b49680eded0a7b2cfa1bfb34423 | 8,526 | py | Python | app/source/dragen/src/scheduler/aws_utils.py | siyervervetx/quickstart-illumina-dragen | 1543b3c6615ab825e5d79a97c6de47340500173f | [
"Apache-2.0"
] | 23 | 2018-10-04T06:56:26.000Z | 2021-10-30T16:47:30.000Z | app/source/dragen/src/scheduler/aws_utils.py | siyervervetx/quickstart-illumina-dragen | 1543b3c6615ab825e5d79a97c6de47340500173f | [
"Apache-2.0"
] | 23 | 2019-06-21T17:20:00.000Z | 2022-03-22T02:55:18.000Z | app/source/dragen/src/scheduler/aws_utils.py | siyervervetx/quickstart-illumina-dragen | 1543b3c6615ab825e5d79a97c6de47340500173f | [
"Apache-2.0"
] | 22 | 2018-10-04T10:12:09.000Z | 2022-02-21T19:56:09.000Z | #!/opt/workflow/bin/python2.7
#
# Copyright 2013-2016 Edico Genome Corporation. All rights reserved.
#
# This file contains confidential and proprietary information of the Edico Genome
# Corporation and is protected under the U.S. and international copyright and other
# intellectual property laws.
#
# $Id$
# $Author$
#... | 37.394737 | 116 | 0.641332 |
from __future__ import absolute_import
from __future__ import division
from builtins import map
from builtins import str
from past.utils import old_div
import os
from glob import glob
from multiprocessing import Pool
import boto3
from boto3.s3.transfer import S3Transfer
from boto3.s3.transfer import TransferConfig
f... | true | true |
f74d3db1aefdd7054183593fbcd1cc842e9b0840 | 3,264 | py | Python | model/a2c.py | linthieda/DeepFEH | 273b5c695674e0d22bc7f701a5d64113034b04de | [
"MIT"
] | 4 | 2018-03-30T13:10:07.000Z | 2018-10-25T10:36:04.000Z | model/a2c.py | gen-ko/DeepFEH | 273b5c695674e0d22bc7f701a5d64113034b04de | [
"MIT"
] | null | null | null | model/a2c.py | gen-ko/DeepFEH | 273b5c695674e0d22bc7f701a5d64113034b04de | [
"MIT"
] | 1 | 2018-04-07T01:59:53.000Z | 2018-04-07T01:59:53.000Z | import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from reinforce import Reinforce
from model import CriticNet
import feh_simulator.simulator as gym
class A2C(Reinforce):
# Implementation of N-step Advantage Actor Critic.
# This class inherits the Reinforce class, so ... | 34 | 139 | 0.522059 | import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from reinforce import Reinforce
from model import CriticNet
import feh_simulator.simulator as gym
class A2C(Reinforce):
def __init__(self, env, lr, critic_lr, gamma, n, policy_path, critic_path, load=False):
... | true | true |
f74d3dcc1db2807336090cb9d59b2b338bc2bb5f | 818 | py | Python | yabgp/message/attribute/nlri/labeled_unicast/ipv4.py | mengjunyi/yabgp | 45b050b401851b2ea94a6a70de124c02487ca677 | [
"Apache-2.0"
] | 203 | 2015-05-15T12:07:30.000Z | 2022-03-13T16:36:03.000Z | yabgp/message/attribute/nlri/labeled_unicast/ipv4.py | mengjunyi/yabgp | 45b050b401851b2ea94a6a70de124c02487ca677 | [
"Apache-2.0"
] | 109 | 2015-05-19T16:07:59.000Z | 2022-03-09T08:18:23.000Z | yabgp/message/attribute/nlri/labeled_unicast/ipv4.py | mengjunyi/yabgp | 45b050b401851b2ea94a6a70de124c02487ca677 | [
"Apache-2.0"
] | 74 | 2015-05-14T15:24:10.000Z | 2022-03-09T06:21:51.000Z | # Copyright 2015-2016 Cisco Systems, Inc.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | 35.565217 | 78 | 0.749389 |
from yabgp.message.attribute.nlri.labeled_unicast import LabeledUnicast
from yabgp.common.afn import AFNUM_INET
class IPv4LabeledUnicast(LabeledUnicast):
AFI = AFNUM_INET
| true | true |
f74d3ddbe1705289ad1af2d86669e367bf327f07 | 1,501 | py | Python | tf_mnf/flows/rnvp.py | janosh/mnf-bnn | c192d9ed89a1cd8117233d2aba9ceea4f67ff863 | [
"MIT"
] | 2 | 2020-04-15T09:10:17.000Z | 2020-06-03T12:44:49.000Z | tf_mnf/flows/rnvp.py | janosh/tf-mnf | 955b083027d8757716e1cdb6baaf908964546e6d | [
"MIT"
] | null | null | null | tf_mnf/flows/rnvp.py | janosh/tf-mnf | 955b083027d8757716e1cdb6baaf908964546e6d | [
"MIT"
] | null | null | null | import tensorflow as tf
class RNVP(tf.Module):
"""Affine half (aka Real Non-Volume Preserving) flow (x = z * exp(s) + t),
where a randomly selected half z1 of the dimensions in z are transformed as an
affine function of the other half z2, i.e. scaled by s(z2) and shifted by t(z2).
From "Density estim... | 39.5 | 87 | 0.614257 | import tensorflow as tf
class RNVP(tf.Module):
def __init__(self, dim, h_sizes=[30], activation="tanh", **kwargs):
super().__init__(**kwargs)
layers = [tf.keras.layers.Dense(hs, activation) for hs in h_sizes]
self.net = tf.keras.Sequential(layers)
self.t = tf.keras.layers.Dense(di... | true | true |
f74d3e09d57430042b406790f16377b11423435d | 634 | py | Python | train/faci_training.py | Dung-Han-Lee/Pointcloud-based-Row-Detection-using-ShellNet-and-PyTorch | 9b57969cf05818839a7ecce37163752e3fddec5e | [
"MIT"
] | 8 | 2020-08-07T20:15:31.000Z | 2021-11-16T02:23:37.000Z | train/faci_training.py | Dung-Han-Lee/Pointcloud-based-Row-Detection-using-ShellNet-and-PyTorch | 9b57969cf05818839a7ecce37163752e3fddec5e | [
"MIT"
] | null | null | null | train/faci_training.py | Dung-Han-Lee/Pointcloud-based-Row-Detection-using-ShellNet-and-PyTorch | 9b57969cf05818839a7ecce37163752e3fddec5e | [
"MIT"
] | 4 | 2020-08-21T06:17:01.000Z | 2021-11-24T07:45:20.000Z | from glob import glob
import config
import errno
import os
def unique_id(msg):
ext = '.txt'
f = glob("*"+ext)[0]
num_trail = int(f.split(".")[0])
newf = "./" + str(num_trail+1) + ext
os.rename(f, newf)
outdir = os.path.join("../weights", config.summary_prefix+"%02d"%num_trail)
mkdir_p(outdi... | 22.642857 | 79 | 0.561514 | from glob import glob
import config
import errno
import os
def unique_id(msg):
ext = '.txt'
f = glob("*"+ext)[0]
num_trail = int(f.split(".")[0])
newf = "./" + str(num_trail+1) + ext
os.rename(f, newf)
outdir = os.path.join("../weights", config.summary_prefix+"%02d"%num_trail)
mkdir_p(outdi... | true | true |
f74d3e384e4739d74623ed39511172cecf32158b | 6,535 | py | Python | wals3/datatables.py | maggie-jiayizhang/wals3 | fa8f9a9cf968920f16859a075a08502988c9ec4d | [
"Apache-2.0"
] | 86 | 2015-03-18T07:47:54.000Z | 2022-03-27T10:16:01.000Z | wals3/datatables.py | maggie-jiayizhang/wals3 | fa8f9a9cf968920f16859a075a08502988c9ec4d | [
"Apache-2.0"
] | 21 | 2015-01-15T14:13:06.000Z | 2021-11-24T11:17:59.000Z | wals3/datatables.py | maggie-jiayizhang/wals3 | fa8f9a9cf968920f16859a075a08502988c9ec4d | [
"Apache-2.0"
] | 16 | 2015-02-13T05:31:11.000Z | 2022-03-03T08:54:37.000Z | from sqlalchemy.orm import joinedload, contains_eager, subqueryload
from clld.web import datatables
from clld.web.datatables.base import Col, LinkCol, DetailsRowLinkCol, IdCol
from clld.web.datatables.value import ValueNameCol
from clld.db.meta import DBSession
from clld.db.models import common
from clld.db.util impor... | 32.351485 | 89 | 0.639939 | from sqlalchemy.orm import joinedload, contains_eager, subqueryload
from clld.web import datatables
from clld.web.datatables.base import Col, LinkCol, DetailsRowLinkCol, IdCol
from clld.web.datatables.value import ValueNameCol
from clld.db.meta import DBSession
from clld.db.models import common
from clld.db.util impor... | true | true |
f74d3ee5bec9892194baef78681876d2be2a85ca | 3,875 | py | Python | .venv/lib/python3.8/site-packages/vectorbt/base/__init__.py | eo1989/VectorBTanalysis | bea3deaf2ee3fc114b308146f2af3e4f35f70197 | [
"MIT"
] | null | null | null | .venv/lib/python3.8/site-packages/vectorbt/base/__init__.py | eo1989/VectorBTanalysis | bea3deaf2ee3fc114b308146f2af3e4f35f70197 | [
"MIT"
] | null | null | null | .venv/lib/python3.8/site-packages/vectorbt/base/__init__.py | eo1989/VectorBTanalysis | bea3deaf2ee3fc114b308146f2af3e4f35f70197 | [
"MIT"
] | null | null | null | """Modules with base classes and utilities for pandas objects, such as broadcasting.
## Array wrapper
vectorbt's functionality is based upon the ability to perform the most essential pandas operations
using NumPy+Numba stack. One has to convert the Series/DataFrame into the NumPy format, perform
the computation, and ... | 34.598214 | 100 | 0.747097 | true | true | |
f74d3f266877284fa47c089847dda82f8b54f95a | 90 | py | Python | ding/model/wrapper/__init__.py | sailxjx/DI-engine | c6763f8e2ba885a2a02f611195a1b5f8b50bff00 | [
"Apache-2.0"
] | 464 | 2021-07-08T07:26:33.000Z | 2022-03-31T12:35:16.000Z | ding/model/wrapper/__init__.py | sailxjx/DI-engine | c6763f8e2ba885a2a02f611195a1b5f8b50bff00 | [
"Apache-2.0"
] | 177 | 2021-07-09T08:22:55.000Z | 2022-03-31T07:35:22.000Z | ding/model/wrapper/__init__.py | sailxjx/DI-engine | c6763f8e2ba885a2a02f611195a1b5f8b50bff00 | [
"Apache-2.0"
] | 92 | 2021-07-08T12:16:37.000Z | 2022-03-31T09:24:41.000Z | from .model_wrappers import model_wrap, register_wrapper, IModelWrapper, BaseModelWrapper
| 45 | 89 | 0.877778 | from .model_wrappers import model_wrap, register_wrapper, IModelWrapper, BaseModelWrapper
| true | true |
f74d3f6e2aa9639dc6e8376d56c37da0ae6fe0e3 | 13,531 | py | Python | src/visualization/plot_thesis.py | masasin/spirit | c8366e649eb105a8a579fb7a47dcc5aaeae6a0d8 | [
"MIT"
] | null | null | null | src/visualization/plot_thesis.py | masasin/spirit | c8366e649eb105a8a579fb7a47dcc5aaeae6a0d8 | [
"MIT"
] | 10 | 2017-03-28T12:11:45.000Z | 2017-03-31T05:44:00.000Z | src/visualization/plot_thesis.py | masasin/spirit | c8366e649eb105a8a579fb7a47dcc5aaeae6a0d8 | [
"MIT"
] | 1 | 2018-06-29T08:19:20.000Z | 2018-06-29T08:19:20.000Z | from functools import partial
from pathlib import Path
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn.apionly as sns
from ..analysis.csv_analysis import analyze_data, load_surveys
from ..data.survey_utils import ExperimentType
from .latexify import latexify, figure, fig_size
fro... | 42.955556 | 80 | 0.559899 | from functools import partial
from pathlib import Path
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn.apionly as sns
from ..analysis.csv_analysis import analyze_data, load_surveys
from ..data.survey_utils import ExperimentType
from .latexify import latexify, figure, fig_size
fro... | true | true |
f74d3f7cd3869a4dfa7052de0457be1739286c27 | 934 | py | Python | python/ex069_estatisticas2.py | lucasdiogomartins/curso-em-video | 9da92b6255a11021f719a9e0ce994db639e1ac38 | [
"MIT"
] | null | null | null | python/ex069_estatisticas2.py | lucasdiogomartins/curso-em-video | 9da92b6255a11021f719a9e0ce994db639e1ac38 | [
"MIT"
] | null | null | null | python/ex069_estatisticas2.py | lucasdiogomartins/curso-em-video | 9da92b6255a11021f719a9e0ce994db639e1ac38 | [
"MIT"
] | null | null | null | mai_idade = homens = fem_men_20 = 0
while True:
print('-'*30)
print('CADASTRE UMA PESSOA')
# inserir dados
idade = int(input('Idade: '))
sexo = input('Sexo [M/F]: ').strip().upper()[0]
while sexo not in 'MF':
sexo = input('ERRO. Digite novamente o sexo: ').strip().upper()[0]
# veri... | 31.133333 | 77 | 0.601713 | mai_idade = homens = fem_men_20 = 0
while True:
print('-'*30)
print('CADASTRE UMA PESSOA')
idade = int(input('Idade: '))
sexo = input('Sexo [M/F]: ').strip().upper()[0]
while sexo not in 'MF':
sexo = input('ERRO. Digite novamente o sexo: ').strip().upper()[0]
if idade >= 18:
... | true | true |
f74d3fdef48d3fa575404a4e4f34307169cfdbc1 | 3,132 | py | Python | qa/rpc-tests/bipdersig.py | mirzaei-ce/core-civilbit | cab3e53bdc6b04a84f4bc48114efc07865be814a | [
"MIT"
] | null | null | null | qa/rpc-tests/bipdersig.py | mirzaei-ce/core-civilbit | cab3e53bdc6b04a84f4bc48114efc07865be814a | [
"MIT"
] | null | null | null | qa/rpc-tests/bipdersig.py | mirzaei-ce/core-civilbit | cab3e53bdc6b04a84f4bc48114efc07865be814a | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test the BIP66 changeover logic
#
from test_framework.test_framework import CivilbitTestFramework
fr... | 35.590909 | 98 | 0.622605 |
from test_framework.test_framework import CivilbitTestFramework
from test_framework.util import *
class BIP66Test(CivilbitTestFramework):
def setup_network(self):
self.nodes = []
self.nodes.append(start_node(0, self.options.tmpdir, []))
self.nodes.append(start_node(1, self.options.tmpdir... | true | true |
f74d3ff3f58d2256abb70825002355c26c1ff6b1 | 1,704 | py | Python | ultisnips/test/test_AnonymousExpansion.py | adrewasa/asavim | 679db0656d35d4cc0b00b8407d5834ff5f3e8765 | [
"Apache-2.0"
] | 28 | 2018-05-11T18:36:45.000Z | 2021-05-16T00:16:18.000Z | ultisnips/test/test_AnonymousExpansion.py | adrewasa/asavim | 679db0656d35d4cc0b00b8407d5834ff5f3e8765 | [
"Apache-2.0"
] | null | null | null | ultisnips/test/test_AnonymousExpansion.py | adrewasa/asavim | 679db0656d35d4cc0b00b8407d5834ff5f3e8765 | [
"Apache-2.0"
] | 13 | 2018-07-20T02:45:35.000Z | 2020-09-01T07:07:53.000Z | from test.vim_test_case import VimTestCase as _VimTest
from test.constant import *
# Anonymous Expansion {{{#
class _AnonBase(_VimTest):
args = ''
def _extra_vim_config(self, vim_config):
vim_config.append('inoremap <silent> %s <C-R>=UltiSnips#Anon(%s)<cr>'
% (EA, self.arg... | 25.058824 | 77 | 0.614437 | from test.vim_test_case import VimTestCase as _VimTest
from test.constant import *
class _AnonBase(_VimTest):
args = ''
def _extra_vim_config(self, vim_config):
vim_config.append('inoremap <silent> %s <C-R>=UltiSnips#Anon(%s)<cr>'
% (EA, self.args))
class Anon_NoTrigger_S... | true | true |
f74d4001312a35bfae688883037bffa18d6f6280 | 1,869 | py | Python | ysharp/ysharp_lexer.py | RezSat/Ysharp-v4 | b475864688b0a5c7040ce5d4a8e8e3c5443cb25f | [
"Apache-2.0"
] | null | null | null | ysharp/ysharp_lexer.py | RezSat/Ysharp-v4 | b475864688b0a5c7040ce5d4a8e8e3c5443cb25f | [
"Apache-2.0"
] | null | null | null | ysharp/ysharp_lexer.py | RezSat/Ysharp-v4 | b475864688b0a5c7040ce5d4a8e8e3c5443cb25f | [
"Apache-2.0"
] | null | null | null | from sly import Lexer
class YsharpLexer(Lexer):
tokens = {
ID,
FLOAT,
INT,
FUNC,
CLASS,
STRING,
EQ_GREATER,
EQ_LESS,
EQEQ,
PYTHON_CODE,
COLON_COLON,
IF,
ELSE,
TRUE,
FALSE,
... | 18.145631 | 72 | 0.326913 | from sly import Lexer
class YsharpLexer(Lexer):
tokens = {
ID,
FLOAT,
INT,
FUNC,
CLASS,
STRING,
EQ_GREATER,
EQ_LESS,
EQEQ,
PYTHON_CODE,
COLON_COLON,
IF,
ELSE,
TRUE,
FALSE,
... | true | true |
f74d407045957463dedb3c28a9e32321f02037d6 | 9,824 | py | Python | hnefatafl/bots.py | m-r-munroe/alphazero-general | 221422e81b01f3b532da210b193692fe125a974c | [
"MIT"
] | null | null | null | hnefatafl/bots.py | m-r-munroe/alphazero-general | 221422e81b01f3b532da210b193692fe125a974c | [
"MIT"
] | null | null | null | hnefatafl/bots.py | m-r-munroe/alphazero-general | 221422e81b01f3b532da210b193692fe125a974c | [
"MIT"
] | null | null | null | from boardgame import BaseBot, BaseBoard, BasePlayer, Move
from hnefatafl.engine import PieceType, variants
from hnefatafl import MODEL_PATH, MODEL_CONFIG_PATH
from alphazero.GenericPlayers import MCTSPlayer, NNPlayer
from threading import Lock
import os
import importlib
import random
import pyximport, numpy
pyximp... | 35.723636 | 137 | 0.632431 | from boardgame import BaseBot, BaseBoard, BasePlayer, Move
from hnefatafl.engine import PieceType, variants
from hnefatafl import MODEL_PATH, MODEL_CONFIG_PATH
from alphazero.GenericPlayers import MCTSPlayer, NNPlayer
from threading import Lock
import os
import importlib
import random
import pyximport, numpy
pyximp... | false | true |
f74d42a9431d3f39af672b587eec68f30fbbebae | 13,118 | py | Python | peachy/collision.py | shelsoloa/Peachy | 2300f617e26f09ab39e2c5fa1a10226a5b0426b9 | [
"MIT"
] | 2 | 2017-06-24T20:24:30.000Z | 2018-08-12T20:06:24.000Z | peachy/collision.py | shelsoloa/Peachy | 2300f617e26f09ab39e2c5fa1a10226a5b0426b9 | [
"MIT"
] | null | null | null | peachy/collision.py | shelsoloa/Peachy | 2300f617e26f09ab39e2c5fa1a10226a5b0426b9 | [
"MIT"
] | null | null | null | from peachy.geo import ShapeEnum
# Collision functions are alphabetical but prioritze rectangles because
# they are most common
"""The max tolerance for floating point errors."""
TOLERANCE = 0.001
def is_between(x, a, b):
return min(a, b) <= x <= max(a, b)
def rect_to_vector_segments(rect):
x, y, width, h... | 28.455531 | 79 | 0.603979 | from peachy.geo import ShapeEnum
TOLERANCE = 0.001
def is_between(x, a, b):
return min(a, b) <= x <= max(a, b)
def rect_to_vector_segments(rect):
x, y, width, height = rect
top = (x, y, width, 0)
right = (x + width, y, 0, height)
bottom = (x + width, y + height, -width, 0)
left = (x, y + h... | true | true |
f74d437fa2a100eaf88e3bd7720402af24c0b2e0 | 3,471 | py | Python | bindings/python/ensmallen/datasets/string/ralstoniainsidiosa.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/string/ralstoniainsidiosa.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/ralstoniainsidiosa.py | AnacletoLAB/ensmallen | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 3 | 2021-01-14T02:20:59.000Z | 2021-08-04T19:09:52.000Z | """
This file offers the methods to automatically retrieve the graph Ralstonia insidiosa.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: protein--protein as... | 33.057143 | 223 | 0.677615 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen import Graph
def RalstoniaInsidiosa(
directed: bool = False,
preprocess: bool = True,
load_nodes: bool = True,
verbose: int = 2,
cache: bool = True,
cache_path: str = "graphs/string"... | true | true |
f74d4462bce1a8606e96b339178089bb9c90df76 | 1,924 | py | Python | saleor/payment/gateways/braintree/forms.py | cck197/saleor | a150dc2aea9f67b5ce15a82f45c90d68e28195ca | [
"CC-BY-4.0"
] | null | null | null | saleor/payment/gateways/braintree/forms.py | cck197/saleor | a150dc2aea9f67b5ce15a82f45c90d68e28195ca | [
"CC-BY-4.0"
] | null | null | null | saleor/payment/gateways/braintree/forms.py | cck197/saleor | a150dc2aea9f67b5ce15a82f45c90d68e28195ca | [
"CC-BY-4.0"
] | null | null | null | from django import forms
from django.core.exceptions import ValidationError
from django.utils.translation import pgettext_lazy
from ...error_codes import PaymentErrorCode
from ...interface import PaymentData
class BraintreePaymentForm(forms.Form):
amount = forms.DecimalField()
# Unique transaction identifie... | 40.083333 | 105 | 0.690229 | from django import forms
from django.core.exceptions import ValidationError
from django.utils.translation import pgettext_lazy
from ...error_codes import PaymentErrorCode
from ...interface import PaymentData
class BraintreePaymentForm(forms.Form):
amount = forms.DecimalField()
# response
... | true | true |
f74d453114abdc8a85ae9b29efbe6c07e77dbc4a | 2,797 | py | Python | dataservice/api/cavatica_task/models.py | ConnorBarnhill/kf-api-dataservice | 547df467a307788882469a25c947a14965a26336 | [
"Apache-2.0"
] | null | null | null | dataservice/api/cavatica_task/models.py | ConnorBarnhill/kf-api-dataservice | 547df467a307788882469a25c947a14965a26336 | [
"Apache-2.0"
] | null | null | null | dataservice/api/cavatica_task/models.py | ConnorBarnhill/kf-api-dataservice | 547df467a307788882469a25c947a14965a26336 | [
"Apache-2.0"
] | null | null | null | from sqlalchemy.dialects.postgresql import UUID
from sqlalchemy.ext.associationproxy import association_proxy
from dataservice.extensions import db
from dataservice.api.common.model import Base, KfId
class CavaticaTask(db.Model, Base):
"""
CavaticaTask entity represents an executed Cavatica task
:param ... | 41.746269 | 79 | 0.608509 | from sqlalchemy.dialects.postgresql import UUID
from sqlalchemy.ext.associationproxy import association_proxy
from dataservice.extensions import db
from dataservice.api.common.model import Base, KfId
class CavaticaTask(db.Model, Base):
__tablename__ = 'cavatica_task'
__prefix__ = 'CT'
external_cavatica_... | true | true |
f74d45e155d0ad53ffa1233cbae87bbdba0819b1 | 3,222 | py | Python | scripts/make_snli_sweep.py | stanfordnlp/spinn | f2f95f585328ec5cd7da071753f5e0582e7600a0 | [
"MIT"
] | 200 | 2016-05-30T03:27:46.000Z | 2022-03-27T04:58:13.000Z | scripts/make_snli_sweep.py | stanfordnlp/spinn | f2f95f585328ec5cd7da071753f5e0582e7600a0 | [
"MIT"
] | 4 | 2016-06-17T19:25:24.000Z | 2017-07-25T01:30:52.000Z | scripts/make_snli_sweep.py | stanfordnlp/spinn | f2f95f585328ec5cd7da071753f5e0582e7600a0 | [
"MIT"
] | 46 | 2016-06-13T06:07:02.000Z | 2022-02-04T17:29:31.000Z | # Create a script to run a random hyperparameter search.
import copy
import getpass
import os
import random
import numpy as np
LIN = "LIN"
EXP = "EXP"
SS_BASE = "SS_BASE"
# Instructions: Configure the variables in this block, then run
# the following on a machine with qsub access:
# python make_sweep.py > my_sweep.s... | 31.588235 | 168 | 0.594972 |
import copy
import getpass
import os
import random
import numpy as np
LIN = "LIN"
EXP = "EXP"
SS_BASE = "SS_BASE"
FIXED_PARAMETERS = {
"data_type": "snli",
"model_type": "Model0",
"training_data_path": "/scr/nlp/data/snli_1.0/snli_1.0_train.jsonl",
"eval_data_path": "/scr/nlp/data/sn... | false | true |
f74d4607da867d9fa5a55f92b1b8130e0a0eff18 | 2,696 | py | Python | .venv/lib/python3.8/site-packages/jeepney/io/common.py | RivtLib/replit01 | ce1ae18b446a9c844f40e88a51c71fbc45ab3ad7 | [
"MIT"
] | 1 | 2021-01-14T15:33:11.000Z | 2021-01-14T15:33:11.000Z | .venv/lib/python3.8/site-packages/jeepney/io/common.py | RivtLib/replit01 | ce1ae18b446a9c844f40e88a51c71fbc45ab3ad7 | [
"MIT"
] | 29 | 2021-08-17T19:09:23.000Z | 2022-03-29T19:08:23.000Z | .venv/lib/python3.8/site-packages/jeepney/io/common.py | RivtLib/replit01 | ce1ae18b446a9c844f40e88a51c71fbc45ab3ad7 | [
"MIT"
] | 2 | 2020-09-10T22:39:34.000Z | 2021-06-27T22:21:55.000Z | from contextlib import contextmanager
from itertools import count
from jeepney import HeaderFields, Message, MessageFlag, MessageType
class MessageFilters:
def __init__(self):
self.filters = {}
self.filter_ids = count()
def matches(self, message):
for handle in self.filters.values():
... | 30.292135 | 77 | 0.643917 | from contextlib import contextmanager
from itertools import count
from jeepney import HeaderFields, Message, MessageFlag, MessageType
class MessageFilters:
def __init__(self):
self.filters = {}
self.filter_ids = count()
def matches(self, message):
for handle in self.filters.values():
... | true | true |
f74d4669b6531efc2617c17c3f4ec7faf64bf4fb | 3,585 | py | Python | Termica.py | afazevedo/MDI_PDE_2030_Linux | 1c6ac0a08fe7fca5478f038173ee91fede680f3a | [
"MIT"
] | null | null | null | Termica.py | afazevedo/MDI_PDE_2030_Linux | 1c6ac0a08fe7fca5478f038173ee91fede680f3a | [
"MIT"
] | null | null | null | Termica.py | afazevedo/MDI_PDE_2030_Linux | 1c6ac0a08fe7fca5478f038173ee91fede680f3a | [
"MIT"
] | null | null | null | from Usina import Usina;
from RecebeDados import RecebeDados;
class Termica(Usina):
def __init__(self, recebe_dados, abaTerm, offset, iTerm, nMeses, nMesesPos, continuidade=False):
# define fonte_dados como o objeto da classe RecebeDados e o nome da aba com as usinas UHE
self.nomeAba ... | 43.719512 | 140 | 0.625662 | from Usina import Usina;
from RecebeDados import RecebeDados;
class Termica(Usina):
def __init__(self, recebe_dados, abaTerm, offset, iTerm, nMeses, nMesesPos, continuidade=False):
self.nomeAba = abaTerm;
self.fonte_dados = recebe_dados;
self.indexUsinaInterno = iTerm;... | true | true |
f74d46d14cbea6d13567079d17e29f299b43e70a | 1,182 | py | Python | app/core/models.py | fakorede-bolu/python-recipe-rest-api | 26ee3a9edae5d4ee974b42a741ffb60af63c9cb7 | [
"MIT"
] | null | null | null | app/core/models.py | fakorede-bolu/python-recipe-rest-api | 26ee3a9edae5d4ee974b42a741ffb60af63c9cb7 | [
"MIT"
] | null | null | null | app/core/models.py | fakorede-bolu/python-recipe-rest-api | 26ee3a9edae5d4ee974b42a741ffb60af63c9cb7 | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, \
PermissionsMixin
class UserManager(BaseUserManager):
def create_user(self, email, password=None, **extra_fields):
"""Creates and saves a new user"""
if not email:
raise ValueEr... | 30.307692 | 76 | 0.686971 | from django.db import models
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, \
PermissionsMixin
class UserManager(BaseUserManager):
def create_user(self, email, password=None, **extra_fields):
if not email:
raise ValueError('User must have a valid email address')... | true | true |
f74d47032ff6861dc47408ee6f4e6f9d27180162 | 3,803 | py | Python | src/ea/libs/PyXmlDict/Test.py | dmachard/extensivetesting | a5c3d2648aebcfaf1d0352a7aff8728ab843b73f | [
"MIT"
] | 9 | 2019-09-01T04:56:28.000Z | 2021-04-08T19:45:52.000Z | src/ea/libs/PyXmlDict/Test.py | dmachard/extensivetesting | a5c3d2648aebcfaf1d0352a7aff8728ab843b73f | [
"MIT"
] | 5 | 2020-10-27T15:05:12.000Z | 2021-12-13T13:48:11.000Z | src/ea/libs/PyXmlDict/Test.py | dmachard/extensivetesting | a5c3d2648aebcfaf1d0352a7aff8728ab843b73f | [
"MIT"
] | 2 | 2019-10-01T06:12:06.000Z | 2020-04-29T13:28:20.000Z | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
# -------------------------------------------------------------------
# Copyright (c) 2010-2021 Denis Machard
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# ... | 34.261261 | 80 | 0.562977 |
import Dict2Xml
import Xml2Dict
if __name__ == '__main__':
codecX2D = Xml2Dict.Xml2Dict()
codecD2X = Dict2Xml.Dict2Xml(coding=None)
xml = """<Family>
<Member Name="Abe" DOB="3/31/42" />
<Member Name="Betty" DOB="2/4/49" />
<Member Name="Edith" Father="Abe" Mother="Betty" DOB="8/30/80" />
<Member Name... | true | true |
f74d47a21c13fab8a3bc1d45b2ef4a056cd95bc2 | 2,903 | py | Python | tests/components/smtp/test_notify.py | domwillcode/home-assistant | f170c80bea70c939c098b5c88320a1c789858958 | [
"Apache-2.0"
] | 2 | 2021-09-13T21:44:02.000Z | 2021-12-17T21:20:51.000Z | tests/components/smtp/test_notify.py | domwillcode/home-assistant | f170c80bea70c939c098b5c88320a1c789858958 | [
"Apache-2.0"
] | 5 | 2021-02-08T20:46:31.000Z | 2022-03-12T00:35:09.000Z | tests/components/smtp/test_notify.py | klauern/home-assistant-core | c18ba6aec0627e6afb6442c678edb5ff2bb17db6 | [
"Apache-2.0"
] | 2 | 2020-11-04T07:40:01.000Z | 2021-09-13T21:44:03.000Z | """The tests for the notify smtp platform."""
import re
import unittest
from homeassistant.components.smtp.notify import MailNotificationService
from tests.async_mock import patch
from tests.common import get_test_home_assistant
class MockSMTP(MailNotificationService):
"""Test SMTP object that doesn't need a wo... | 33.367816 | 81 | 0.561144 | import re
import unittest
from homeassistant.components.smtp.notify import MailNotificationService
from tests.async_mock import patch
from tests.common import get_test_home_assistant
class MockSMTP(MailNotificationService):
def _send_email(self, msg):
return msg.as_string()
class TestNotifySmtp(unitt... | true | true |
f74d48a8321d6f6073cc1e3da852cd31ba0178b0 | 2,978 | py | Python | problems/OF/auto/problem80_OF.py | sunandita/ICAPS_Summer_School_RAE_2020 | a496b62185bcfdd2c76eb7986ae99cfa85708d28 | [
"BSD-3-Clause"
] | 5 | 2020-10-15T14:40:03.000Z | 2021-08-20T17:45:41.000Z | problems/OF/auto/problem80_OF.py | sunandita/ICAPS_Summer_School_RAE_2020 | a496b62185bcfdd2c76eb7986ae99cfa85708d28 | [
"BSD-3-Clause"
] | null | null | null | problems/OF/auto/problem80_OF.py | sunandita/ICAPS_Summer_School_RAE_2020 | a496b62185bcfdd2c76eb7986ae99cfa85708d28 | [
"BSD-3-Clause"
] | 2 | 2020-10-15T07:06:14.000Z | 2020-10-15T17:33:01.000Z | __author__ = 'mason'
from domain_orderFulfillment import *
from timer import DURATION
from state import state
import numpy as np
'''
This is a randomly generated problem
'''
def GetCostOfMove(id, r, loc1, loc2, dist):
return 1 + dist
def GetCostOfLookup(id, item):
return max(1, np.random.beta(2, 2))
def Ge... | 35.035294 | 407 | 0.602082 | __author__ = 'mason'
from domain_orderFulfillment import *
from timer import DURATION
from state import state
import numpy as np
def GetCostOfMove(id, r, loc1, loc2, dist):
return 1 + dist
def GetCostOfLookup(id, item):
return max(1, np.random.beta(2, 2))
def GetCostOfWrap(id, orderName, m, item):
retu... | true | true |
f74d48b750865114a03efeb71e464bf93549ef0d | 16,714 | py | Python | data_reader.py | ruanchaves/Dual-encoder-Entity-Retrieval-with-BERT | ff8c7933afaf0b2c40a7df0250f4b82a5868dc2a | [
"MIT"
] | 7 | 2020-11-08T08:30:09.000Z | 2021-07-12T09:50:50.000Z | data_reader.py | ruanchaves/Dual-encoder-Entity-Retrieval-with-BERT | ff8c7933afaf0b2c40a7df0250f4b82a5868dc2a | [
"MIT"
] | 3 | 2020-08-11T03:08:07.000Z | 2020-12-22T12:06:08.000Z | data_reader.py | ruanchaves/Dual-encoder-Entity-Retrieval-with-BERT | ff8c7933afaf0b2c40a7df0250f4b82a5868dc2a | [
"MIT"
] | 1 | 2020-08-10T22:31:17.000Z | 2020-08-10T22:31:17.000Z | import numpy as np
from tqdm import tqdm
import torch
import pdb
from typing import Iterator
from allennlp.data import Instance
from allennlp.data.dataset_readers import DatasetReader
from allennlp.data.token_indexers import TokenIndexer, SingleIdTokenIndexer, PretrainedTransformerIndexer
from allennlp.data.fields impo... | 47.08169 | 176 | 0.682781 | import numpy as np
from tqdm import tqdm
import torch
import pdb
from typing import Iterator
from allennlp.data import Instance
from allennlp.data.dataset_readers import DatasetReader
from allennlp.data.token_indexers import TokenIndexer, SingleIdTokenIndexer, PretrainedTransformerIndexer
from allennlp.data.fields impo... | true | true |
f74d498f0d08acf63fb1170e3442f20e0740ce6e | 2,813 | py | Python | orfd/setting.py | 1uvu/orfd-vec | 3365b06ba742831e4d97204157ef2efef4427711 | [
"MIT"
] | null | null | null | orfd/setting.py | 1uvu/orfd-vec | 3365b06ba742831e4d97204157ef2efef4427711 | [
"MIT"
] | null | null | null | orfd/setting.py | 1uvu/orfd-vec | 3365b06ba742831e4d97204157ef2efef4427711 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File : setting.py
@Desc :
@Project : orfd-platform
@Contact : thefreer@outlook.com
@License : (C)Copyright 2018-2019, TheFreer.NET
@WebSite : www.thefreer.net
@Modify Time @Author @Version
------------ ------- ... | 27.31068 | 109 | 0.633132 | import os
FILTER = [
"Company_ID", "companyBaseUrl", "companyTrade", "companyType",
"teamTime", "entUrl", "companyDetailUrl", "Job_ID", "browserNum",
"jobUpdateTime", "jobDetailUrl", "companyName", "estiblishDate",
"companyAddr", "jobAddr", "regAuthority", "businessScope",
]
ORIGIN_PATH = "./Core/dataset/origin.c... | true | true |
f74d4b24710c895c6832b12abb2acf50216eb9a4 | 799 | py | Python | cssProject/cssProject/urls.py | cs-fullstack-2019-spring/django-bootstrap-grid-cw-MelaatiJ | 2b25d1d028818dd407d44cf7200861db2883e4d0 | [
"Apache-2.0"
] | null | null | null | cssProject/cssProject/urls.py | cs-fullstack-2019-spring/django-bootstrap-grid-cw-MelaatiJ | 2b25d1d028818dd407d44cf7200861db2883e4d0 | [
"Apache-2.0"
] | null | null | null | cssProject/cssProject/urls.py | cs-fullstack-2019-spring/django-bootstrap-grid-cw-MelaatiJ | 2b25d1d028818dd407d44cf7200861db2883e4d0 | [
"Apache-2.0"
] | null | null | null | """cssProject URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-ba... | 34.73913 | 77 | 0.703379 | from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path("", include("cssApp.urls")),
path('admin/', admin.site.urls),
]
| true | true |
f74d4b7e610dc83fd46e406c333d443d7a3ed463 | 2,907 | py | Python | util.py | sanjitjain2/soundnet_tf | ba8d85246dbf14f2573ad5b46355ae512bb630de | [
"MIT"
] | null | null | null | util.py | sanjitjain2/soundnet_tf | ba8d85246dbf14f2573ad5b46355ae512bb630de | [
"MIT"
] | null | null | null | util.py | sanjitjain2/soundnet_tf | ba8d85246dbf14f2573ad5b46355ae512bb630de | [
"MIT"
] | null | null | null | import numpy as np
import librosa
# import pdb
import wget
local_config = {
'batch_size': 64,
'load_size': 22050*20,
'phase': 'extract'
}
def get_audio(audio_link):
file_name = audio_link.split('/')[-1]
save_location = "/Users/sanjitjain/projects/soundnet_tf/da... | 31.945055 | 113 | 0.667699 | import numpy as np
import librosa
import wget
local_config = {
'batch_size': 64,
'load_size': 22050*20,
'phase': 'extract'
}
def get_audio(audio_link):
file_name = audio_link.split('/')[-1]
save_location = "/Users/sanjitjain/projects/soundnet_tf/data/"
wget... | true | true |
f74d4c465c838236b8149010306c00a774304142 | 1,659 | py | Python | voltha/core/config/config_branch.py | Balaji-P/voltha_docker_compose-rsk_tech_CKAD | 3cf9b2e2bbbaeed4744ff9f33a3e91e60c8020b7 | [
"Apache-2.0"
] | null | null | null | voltha/core/config/config_branch.py | Balaji-P/voltha_docker_compose-rsk_tech_CKAD | 3cf9b2e2bbbaeed4744ff9f33a3e91e60c8020b7 | [
"Apache-2.0"
] | null | null | null | voltha/core/config/config_branch.py | Balaji-P/voltha_docker_compose-rsk_tech_CKAD | 3cf9b2e2bbbaeed4744ff9f33a3e91e60c8020b7 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2016 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 30.722222 | 75 | 0.693189 |
from collections import OrderedDict
from weakref import WeakValueDictionary
class ConfigBranch(object):
__slots__ = (
'_node', '_txid', '_origin', '_revs', '_latest', '__weakref__'
)
def __init__(self, node, txid=None, origin=None, auto_prune=True):... | true | true |
f74d4c4c48852a0a927200d61c334853bd8ee144 | 4,502 | py | Python | Lib/gftools/actions/updateupstream.py | moontypespace/gftools | 9ff6932eb887e4c1e05dd94107aa0c3438ae26a9 | [
"Apache-2.0"
] | null | null | null | Lib/gftools/actions/updateupstream.py | moontypespace/gftools | 9ff6932eb887e4c1e05dd94107aa0c3438ae26a9 | [
"Apache-2.0"
] | null | null | null | Lib/gftools/actions/updateupstream.py | moontypespace/gftools | 9ff6932eb887e4c1e05dd94107aa0c3438ae26a9 | [
"Apache-2.0"
] | null | null | null | """Generates an upstream.yaml from a config.yaml and a GitHub release URL
"""
import argparse
import os
from tempfile import TemporaryDirectory
import yaml
import zipfile
import gftools.packager
from gftools.builder import GFBuilder
from strictyaml import as_document
from gftools.utils import download_file
from fontT... | 34.366412 | 103 | 0.582852 | import argparse
import os
from tempfile import TemporaryDirectory
import yaml
import zipfile
import gftools.packager
from gftools.builder import GFBuilder
from strictyaml import as_document
from gftools.utils import download_file
from fontTools.ttLib import TTFont
parser = argparse.ArgumentParser(description="Proces... | true | true |
f74d4c898d06df910c626ea36dbe108ca83084bc | 2,863 | py | Python | azext_iot/sdk/iothub/device/models/module_py3.py | lucadruda/azure-iot-cli-extension | 9d2f677d19580f8fbac860e079550167e743a237 | [
"MIT"
] | 79 | 2017-09-25T19:29:17.000Z | 2022-03-30T20:55:57.000Z | azext_iot/sdk/iothub/device/models/module_py3.py | lucadruda/azure-iot-cli-extension | 9d2f677d19580f8fbac860e079550167e743a237 | [
"MIT"
] | 305 | 2018-01-17T01:12:10.000Z | 2022-03-23T22:38:11.000Z | azext_iot/sdk/iothub/device/models/module_py3.py | lucadruda/azure-iot-cli-extension | 9d2f677d19580f8fbac860e079550167e743a237 | [
"MIT"
] | 69 | 2017-11-14T00:30:46.000Z | 2022-03-01T17:11:45.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 43.378788 | 295 | 0.655955 |
from msrest.serialization import Model
class Module(Model):
_attribute_map = {
'module_id': {'key': 'moduleId', 'type': 'str'},
'managed_by': {'key': 'managedBy', 'type': 'str'},
'device_id': {'key': 'deviceId', 'type': 'str'},
'generation_id': {'key': 'generationId', 'type': 'st... | true | true |
f74d4cfa9ec159f9f20397cf8ade3a0d19fcc9cf | 11,669 | py | Python | clients/kratos/python/ory_kratos_client/model/json_error.py | tobbbles/sdk | 017ca2fd46019bafd1853913b6c0f2b0fe687621 | [
"Apache-2.0"
] | null | null | null | clients/kratos/python/ory_kratos_client/model/json_error.py | tobbbles/sdk | 017ca2fd46019bafd1853913b6c0f2b0fe687621 | [
"Apache-2.0"
] | null | null | null | clients/kratos/python/ory_kratos_client/model/json_error.py | tobbbles/sdk | 017ca2fd46019bafd1853913b6c0f2b0fe687621 | [
"Apache-2.0"
] | null | null | null | """
Ory Kratos API
Documentation for all public and administrative Ory Kratos APIs. Public and administrative APIs are exposed on different ports. Public APIs can face the public internet without any protection while administrative APIs should never be exposed without prior authorization. To protect the admini... | 43.379182 | 446 | 0.579655 |
import re import sys
from ory_kratos_client.model_utils import ( ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info,
)
fro... | true | true |
f74d4d84fdf27373fc50cc41637eccc1336f4f87 | 1,094 | py | Python | procurement_portal/records/admin.py | TomaszKolek/procurement-portal-backend | d51e4e2d2df87e6cddabbe56ddaa813daa96c613 | [
"MIT"
] | null | null | null | procurement_portal/records/admin.py | TomaszKolek/procurement-portal-backend | d51e4e2d2df87e6cddabbe56ddaa813daa96c613 | [
"MIT"
] | null | null | null | procurement_portal/records/admin.py | TomaszKolek/procurement-portal-backend | d51e4e2d2df87e6cddabbe56ddaa813daa96c613 | [
"MIT"
] | null | null | null | from django.contrib import admin
from . import models
class DatasetVersionInline(admin.TabularInline):
model = models.DatasetVersion
class DatasetAdmin(admin.ModelAdmin):
inlines = [
DatasetVersionInline,
]
admin.site.register(models.Repository)
admin.site.register(models.Dataset, DatasetAdmi... | 21.45098 | 63 | 0.647166 | from django.contrib import admin
from . import models
class DatasetVersionInline(admin.TabularInline):
model = models.DatasetVersion
class DatasetAdmin(admin.ModelAdmin):
inlines = [
DatasetVersionInline,
]
admin.site.register(models.Repository)
admin.site.register(models.Dataset, DatasetAdmi... | true | true |
f74d4dec37d2b0081fdcb1c6eadef8e7acc5d6e6 | 2,206 | py | Python | src/jukeboxcore/gui/widgets/releasewin_ui.py | JukeboxPipeline/jukebox-core | bac2280ca49940355270e4b69400ce9976ab2e6f | [
"BSD-3-Clause"
] | 2 | 2015-01-22T17:39:10.000Z | 2015-03-31T09:03:24.000Z | src/jukeboxcore/gui/widgets/releasewin_ui.py | JukeboxPipeline/jukebox-core | bac2280ca49940355270e4b69400ce9976ab2e6f | [
"BSD-3-Clause"
] | 3 | 2016-10-28T16:11:14.000Z | 2020-06-05T17:46:08.000Z | src/jukeboxcore/gui/widgets/releasewin_ui.py | JukeboxPipeline/jukebox-core | bac2280ca49940355270e4b69400ce9976ab2e6f | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'h:\projects\jukebox-core\src\jukeboxcore\gui\widgets\releasewin.ui'
#
# Created: Mon Nov 03 16:58:04 2014
# by: pyside-uic 0.2.15 running on PySide 1.2.2
#
# WARNING! All changes made in this file will be lost!
from PySide import QtCor... | 45.958333 | 130 | 0.724841 |
from PySide import QtCore, QtGui
class Ui_release_mwin(object):
def setupUi(self, release_mwin):
release_mwin.setObjectName("release_mwin")
release_mwin.resize(1009, 764)
self.central_widget = QtGui.QWidget(release_mwin)
self.central_widget.setObjectName("central_widget")
... | true | true |
f74d4ea81a9154afa5e1374b5fd8c7a2281084e6 | 822 | py | Python | configs/paths_config.py | johnberg1/psp_s | 717f4c448a4e7537cf4b74067d454c7644609ca3 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT"
] | null | null | null | configs/paths_config.py | johnberg1/psp_s | 717f4c448a4e7537cf4b74067d454c7644609ca3 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT"
] | null | null | null | configs/paths_config.py | johnberg1/psp_s | 717f4c448a4e7537cf4b74067d454c7644609ca3 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT"
] | null | null | null | dataset_paths = {
'celeba_train': '/scratch/users/abaykal20/sam/SAM/mmcelebhq/train_images/',
'celeba_test': '/scratch/users/abaykal20/sam/SAM/mmcelebhq/test_images/',
'celeba_train_sketch': '',
'celeba_test_sketch': '',
'celeba_train_segmentation': '',
'celeba_test_segmentation': '',
'ffhq': '/datasets/CelebAMa... | 39.142857 | 76 | 0.76399 | dataset_paths = {
'celeba_train': '/scratch/users/abaykal20/sam/SAM/mmcelebhq/train_images/',
'celeba_test': '/scratch/users/abaykal20/sam/SAM/mmcelebhq/test_images/',
'celeba_train_sketch': '',
'celeba_test_sketch': '',
'celeba_train_segmentation': '',
'celeba_test_segmentation': '',
'ffhq': '/datasets/CelebAMa... | true | true |
f74d4ec19a65c1d8761a4cea1f879e5436e70e76 | 18,208 | py | Python | LogSystem_JE/venv/Lib/site-packages/pygments/lexers/factor.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | LogSystem_JE/venv/Lib/site-packages/pygments/lexers/factor.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | LogSystem_JE/venv/Lib/site-packages/pygments/lexers/factor.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
pygments.lexers.factor
~~~~~~~~~~~~~~~~~~~~~~
Lexers for the Factor language.
:copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, bygroups, default... | 52.776812 | 107 | 0.50033 |
import re
from pygments.lexer import RegexLexer, bygroups, default, words
from pygments.token import Text, Comment, Keyword, Name, String, Number
__all__ = ['FactorLexer']
class FactorLexer(RegexLexer):
name = 'Factor'
aliases = ['factor']
filenames = ['*.factor']
mimetypes = ['text/x-... | true | true |
f74d4f5af0f2eacfd823e2154327603a10098491 | 6,914 | py | Python | LeetCode/hard/binary_tree_maximum_path_sum.py | hnc01/online-judge | d306dc32c9d8600a987affbe4e4b80809f0b0982 | [
"MIT"
] | null | null | null | LeetCode/hard/binary_tree_maximum_path_sum.py | hnc01/online-judge | d306dc32c9d8600a987affbe4e4b80809f0b0982 | [
"MIT"
] | null | null | null | LeetCode/hard/binary_tree_maximum_path_sum.py | hnc01/online-judge | d306dc32c9d8600a987affbe4e4b80809f0b0982 | [
"MIT"
] | null | null | null | '''
https://leetcode.com/problems/binary-tree-maximum-path-sum/
124. Binary Tree Maximum Path Sum
A path in a binary tree is a sequence of nodes where each pair of adjacent nodes in the sequence has
an edge connecting them. A node can only appear in the sequence at most once. Note that the path does n... | 38.842697 | 140 | 0.633353 | import random
class TreeNode:
def __init__(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
class Solution:
def maxPathSum(self, root: [TreeNode]) -> int:
def maxPathSumHelper(node):
if node is None:
... | true | true |
f74d50ca0a5b67a157ee8d47a0cfa49b431650b0 | 6,136 | py | Python | tests/test_filealchemy.py | calpt/flask-filealchemy | b3575299f0230d5a64865af8066122c2e0c485ec | [
"MIT"
] | null | null | null | tests/test_filealchemy.py | calpt/flask-filealchemy | b3575299f0230d5a64865af8066122c2e0c485ec | [
"MIT"
] | null | null | null | tests/test_filealchemy.py | calpt/flask-filealchemy | b3575299f0230d5a64865af8066122c2e0c485ec | [
"MIT"
] | null | null | null | from textwrap import dedent
import pytest
from sqlalchemy import Column, ForeignKey, String, Text
from sqlalchemy.orm import relationship
from flask_filealchemy import FileAlchemy, LoadError
def test_directory_does_not_exist(db):
app = db.get_app()
class Author(db.Model):
__tablename__ = 'authors'
... | 25.044898 | 67 | 0.605443 | from textwrap import dedent
import pytest
from sqlalchemy import Column, ForeignKey, String, Text
from sqlalchemy.orm import relationship
from flask_filealchemy import FileAlchemy, LoadError
def test_directory_does_not_exist(db):
app = db.get_app()
class Author(db.Model):
__tablename__ = 'authors'
... | true | true |
f74d50d6ed0e8ce2ffae743a640212a4bb68d598 | 7,423 | py | Python | kubernetes_asyncio/client/models/v1beta1_validating_webhook_configuration_list.py | playground-julia/kubernetes_asyncio | 91b2c41eedd282d9ebc059377fb7f207e220133d | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/client/models/v1beta1_validating_webhook_configuration_list.py | playground-julia/kubernetes_asyncio | 91b2c41eedd282d9ebc059377fb7f207e220133d | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/client/models/v1beta1_validating_webhook_configuration_list.py | playground-julia/kubernetes_asyncio | 91b2c41eedd282d9ebc059377fb7f207e220133d | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v1.15.9
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
fr... | 36.033981 | 295 | 0.652432 |
import pprint
import re
import six
from kubernetes_asyncio.client.configuration import Configuration
class V1beta1ValidatingWebhookConfigurationList(object):
openapi_types = {
'api_version': 'str',
'items': 'list[V1beta1ValidatingWebhookConfiguration]',
'kind': 'str',
'metad... | true | true |
f74d519e41f8b45eb1aa661ada3477ccfe039409 | 390 | py | Python | examples/migrations/0016_parsed_data_url.py | kimbackdoo/Web-Cralwer | 6a92ec00ea2273f228b8c304cd596ad9120c4709 | [
"MIT"
] | null | null | null | examples/migrations/0016_parsed_data_url.py | kimbackdoo/Web-Cralwer | 6a92ec00ea2273f228b8c304cd596ad9120c4709 | [
"MIT"
] | null | null | null | examples/migrations/0016_parsed_data_url.py | kimbackdoo/Web-Cralwer | 6a92ec00ea2273f228b8c304cd596ad9120c4709 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.11 on 2020-06-08 07:45
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('examples', '0015_img_data_img_folder_path'),
]
operations = [
migrations.AddField(
model_name='parsed_data',
name='... | 20.526316 | 54 | 0.597436 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('examples', '0015_img_data_img_folder_path'),
]
operations = [
migrations.AddField(
model_name='parsed_data',
name='url',
field=models.URLField(default='... | true | true |
f74d5267be0718666cc080e859a63fcc7b354473 | 272 | py | Python | provider/utils.py | marinewater/pyramid-social-auth | 926f230294ec6b0fdf02a5ed4113073d82a9d18c | [
"MIT"
] | 2 | 2015-02-10T01:19:21.000Z | 2016-07-24T14:40:59.000Z | provider/utils.py | marinewater/pyramid-social-auth | 926f230294ec6b0fdf02a5ed4113073d82a9d18c | [
"MIT"
] | null | null | null | provider/utils.py | marinewater/pyramid-social-auth | 926f230294ec6b0fdf02a5ed4113073d82a9d18c | [
"MIT"
] | null | null | null | from provider.facebook import FacebookProvider
providers = {
'facebook': FacebookProvider
}
def get_provider(provider):
if provider in providers:
return providers[provider]
else:
raise NotImplementedError('no provider named "%s"' % provider) | 22.666667 | 70 | 0.713235 | from provider.facebook import FacebookProvider
providers = {
'facebook': FacebookProvider
}
def get_provider(provider):
if provider in providers:
return providers[provider]
else:
raise NotImplementedError('no provider named "%s"' % provider) | true | true |
f74d53587c47812cfa6d9fda36bb51fadfd86931 | 12,231 | py | Python | splinter/driver/zopetestbrowser.py | StephenDavidson/splinter | 54620f60a565f76d6b7b43560cc5c41deebf53ab | [
"BSD-3-Clause"
] | null | null | null | splinter/driver/zopetestbrowser.py | StephenDavidson/splinter | 54620f60a565f76d6b7b43560cc5c41deebf53ab | [
"BSD-3-Clause"
] | null | null | null | splinter/driver/zopetestbrowser.py | StephenDavidson/splinter | 54620f60a565f76d6b7b43560cc5c41deebf53ab | [
"BSD-3-Clause"
] | 1 | 2015-01-09T02:04:45.000Z | 2015-01-09T02:04:45.000Z | # -*- coding: utf-8 -*-
# Copyright 2012 splinter authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
import re
from lxml.cssselect import CSSSelector
from zope.testbrowser.browser import Browser, ListControl
from splinter.element_list i... | 31.361538 | 126 | 0.639931 |
import re
from lxml.cssselect import CSSSelector
from zope.testbrowser.browser import Browser, ListControl
from splinter.element_list import ElementList
from splinter.exceptions import ElementDoesNotExist
from splinter.driver import DriverAPI, ElementAPI
from splinter.cookie_manager import CookieManagerAPI
import m... | true | true |
f74d550757ffab9a2fd52ce2e9b4f876e20dabda | 510 | py | Python | practice/practice76.py | tomhaoye/LetsPython | 3c5f66d2e672067ed9aea33c0abd6b01708734ff | [
"MIT"
] | null | null | null | practice/practice76.py | tomhaoye/LetsPython | 3c5f66d2e672067ed9aea33c0abd6b01708734ff | [
"MIT"
] | null | null | null | practice/practice76.py | tomhaoye/LetsPython | 3c5f66d2e672067ed9aea33c0abd6b01708734ff | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: UTF-8 -*-
def ou(n):
s = 0.0
if n < 2:
return 0
else:
for j in range(n, 0, -2):
s += (1.0 / j)
print j
return s
def ji(n):
s = 0.0
if n < 1:
return 0
else:
for i in range(n, 0, -2):
s ... | 15.454545 | 41 | 0.392157 |
def ou(n):
s = 0.0
if n < 2:
return 0
else:
for j in range(n, 0, -2):
s += (1.0 / j)
print j
return s
def ji(n):
s = 0.0
if n < 1:
return 0
else:
for i in range(n, 0, -2):
s += (1.0 / i)
print i
r... | false | true |
f74d56a213ee0b608fbd16b3104179e8a9ea70aa | 3,434 | py | Python | cxray/predict-cls-vis.py | aaalgo/aardvark | cdd42acdc20e85f4b3070dd1486f3dc9c9a9b905 | [
"BSD-2-Clause"
] | 2 | 2018-07-31T07:02:18.000Z | 2018-08-01T13:16:30.000Z | cxray/predict-cls-vis.py | aaalgo/aardvark | cdd42acdc20e85f4b3070dd1486f3dc9c9a9b905 | [
"BSD-2-Clause"
] | null | null | null | cxray/predict-cls-vis.py | aaalgo/aardvark | cdd42acdc20e85f4b3070dd1486f3dc9c9a9b905 | [
"BSD-2-Clause"
] | 4 | 2018-07-02T22:02:46.000Z | 2018-07-31T07:30:26.000Z | #!/usr/bin/env python3
import os
import sys
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
sys.path.append('..')
import numpy as np
import cv2
import tensorflow as tf
from tensorflow.python.framework import meta_graph
from mold import Scaling
from gallery import Gallery
from chest import *
class Model:
def __init__ (sel... | 35.770833 | 143 | 0.576296 | import os
import sys
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
sys.path.append('..')
import numpy as np
import cv2
import tensorflow as tf
from tensorflow.python.framework import meta_graph
from mold import Scaling
from gallery import Gallery
from chest import *
class Model:
def __init__ (self, X, path, name):
... | true | true |
f74d56aad1cd5e53bec0c7c3636d700b5a4178bc | 3,668 | py | Python | securitybot/tasker/tasker.py | yanlinw/securitybot | 79c0ef1e1e5686b82739ce09cd8c44972d4edd88 | [
"Apache-2.0"
] | null | null | null | securitybot/tasker/tasker.py | yanlinw/securitybot | 79c0ef1e1e5686b82739ce09cd8c44972d4edd88 | [
"Apache-2.0"
] | null | null | null | securitybot/tasker/tasker.py | yanlinw/securitybot | 79c0ef1e1e5686b82739ce09cd8c44972d4edd88 | [
"Apache-2.0"
] | 1 | 2018-06-12T16:51:15.000Z | 2018-06-12T16:51:15.000Z | '''
A system for retrieving and assigning tasks for the bot as well as updating
their statuses once acted up. This file contains two abstract classes,
Tasker and Task, which define a class to manage tasks and a task class
respectively.
'''
__author__ = 'Alex Bertsch'
__email__ = 'abertsch@dropbox.com'
from abc import ... | 33.345455 | 98 | 0.615322 | __author__ = 'Alex Bertsch'
__email__ = 'abertsch@dropbox.com'
from abc import ABCMeta, abstractmethod
from securitybot.util import enum
class Tasker(object):
__metaclass__ = ABCMeta
@abstractmethod
def get_new_tasks(self):
pass
@abstractmethod
def get_active_tasks(self):
... | true | true |
f74d56c010fbea484f653240b0b037ca92f9794c | 1,047 | py | Python | fuzzer/fuzz.py | jamesquilty/mdformat | 54f549e57a226701c1812fb8a2b478a847172699 | [
"MIT"
] | null | null | null | fuzzer/fuzz.py | jamesquilty/mdformat | 54f549e57a226701c1812fb8a2b478a847172699 | [
"MIT"
] | null | null | null | fuzzer/fuzz.py | jamesquilty/mdformat | 54f549e57a226701c1812fb8a2b478a847172699 | [
"MIT"
] | null | null | null | import atheris
with atheris.instrument_imports():
import sys
import warnings
import mdformat
from mdformat._util import is_md_equal
# Suppress all warnings.
warnings.simplefilter("ignore")
def test_one_input(input_bytes: bytes) -> None:
# We need a Unicode string, not bytes
fdp = atheris.Fu... | 23.266667 | 85 | 0.690544 | import atheris
with atheris.instrument_imports():
import sys
import warnings
import mdformat
from mdformat._util import is_md_equal
warnings.simplefilter("ignore")
def test_one_input(input_bytes: bytes) -> None:
fdp = atheris.FuzzedDataProvider(input_bytes)
data = fdp.ConsumeUnicode(sys... | true | true |
f74d57d5160a6cc6a8512d3091557526ba491b9a | 5,385 | py | Python | scripts/docking_demo.py | Open-UAV/cps_challenge_2020 | 6471e5b150a3bdea6a9c512a520e977ca1ddf432 | [
"Apache-2.0"
] | 1 | 2021-06-05T11:09:54.000Z | 2021-06-05T11:09:54.000Z | scripts/docking_demo.py | Open-UAV/cps_challenge_2020 | 6471e5b150a3bdea6a9c512a520e977ca1ddf432 | [
"Apache-2.0"
] | null | null | null | scripts/docking_demo.py | Open-UAV/cps_challenge_2020 | 6471e5b150a3bdea6a9c512a520e977ca1ddf432 | [
"Apache-2.0"
] | 2 | 2020-07-26T15:40:24.000Z | 2021-01-05T07:28:26.000Z | """
Harish
2020-05-14
"""
import rospy
from geometry_msgs.msg import PoseStamped
from mavros_msgs.msg import State, PositionTarget
import math
from mavros_msgs.srv import SetMode, CommandBool
from std_msgs.msg import String, Header
import subprocess
class OffboardControl:
""" Controller for PX4-UAV offboa... | 34.299363 | 116 | 0.564345 |
import rospy
from geometry_msgs.msg import PoseStamped
from mavros_msgs.msg import State, PositionTarget
import math
from mavros_msgs.srv import SetMode, CommandBool
from std_msgs.msg import String, Header
import subprocess
class OffboardControl:
def __init__(self):
self.curr_pose = PoseStamped()
... | true | true |
f74d5b017fe65f017d8c615cd34ef37ba0a2d4cc | 1,701 | py | Python | courses/data_analysis/deepdive/bigtable-exercises/python/ex3.py | Glairly/introduction_to_tensorflow | aa0a44d9c428a6eb86d1f79d73f54c0861b6358d | [
"Apache-2.0"
] | 2 | 2022-01-06T11:52:57.000Z | 2022-01-09T01:53:56.000Z | courses/data_analysis/deepdive/bigtable-exercises/python/ex3.py | Glairly/introduction_to_tensorflow | aa0a44d9c428a6eb86d1f79d73f54c0861b6358d | [
"Apache-2.0"
] | null | null | null | courses/data_analysis/deepdive/bigtable-exercises/python/ex3.py | Glairly/introduction_to_tensorflow | aa0a44d9c428a6eb86d1f79d73f54c0861b6358d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2016 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 33.352941 | 85 | 0.726044 |
"""
Read from our rollups data and print every time minute-over-minute
transaction volume drops more than 50%.
"""
import argparse
from google.cloud import bigtable
def main(project_id, instance_id, table_id):
client = bigtable.Client(project=project_id)
instance = client.instance(instance_id)
... | false | true |
f74d5ba431e2933e346d8430e9ba9b2ad20af170 | 10,873 | py | Python | PaddleCV/PaddleDetection/tools/face_eval.py | shippingwang/models | a92e212932b764e500a833527e0fb772ac9a491a | [
"Apache-2.0"
] | 4 | 2020-01-04T13:15:02.000Z | 2021-07-21T07:50:02.000Z | PaddleCV/PaddleDetection/tools/face_eval.py | shippingwang/models | a92e212932b764e500a833527e0fb772ac9a491a | [
"Apache-2.0"
] | null | null | null | PaddleCV/PaddleDetection/tools/face_eval.py | shippingwang/models | a92e212932b764e500a833527e0fb772ac9a491a | [
"Apache-2.0"
] | 3 | 2019-10-31T07:18:49.000Z | 2020-01-13T03:18:39.000Z | # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 36.364548 | 126 | 0.60241 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import paddle.fluid as fluid
import numpy as np
from PIL import Image
from collections import OrderedDict
import ppdet.utils.checkpoint as checkpoint
from ppdet.utils.cli import ArgsParser
from ppd... | true | true |
f74d5bdc4aa52ab1c2b00688dedaa6f822a0eb7f | 513 | py | Python | joelenc/setup.py | DaMuffinDev/joel.enc | ab955215b2f4bdfe3b0db8e8d31aaf02e85e137f | [
"MIT"
] | null | null | null | joelenc/setup.py | DaMuffinDev/joel.enc | ab955215b2f4bdfe3b0db8e8d31aaf02e85e137f | [
"MIT"
] | null | null | null | joelenc/setup.py | DaMuffinDev/joel.enc | ab955215b2f4bdfe3b0db8e8d31aaf02e85e137f | [
"MIT"
] | null | null | null | from Cython.Build import cythonize
import pkg_resources
from setuptools import setup, Extension
import os
import sys
here = os.path.dirname(os.path.abspath(__file__))
extensions = []
files = {
0: "_enc_proc",
1: "_utils",
2: "_table",
3: "_encrypt",
}
for i in range(4):
filename = files[i]
exte... | 23.318182 | 116 | 0.688109 | from Cython.Build import cythonize
import pkg_resources
from setuptools import setup, Extension
import os
import sys
here = os.path.dirname(os.path.abspath(__file__))
extensions = []
files = {
0: "_enc_proc",
1: "_utils",
2: "_table",
3: "_encrypt",
}
for i in range(4):
filename = files[i]
exte... | true | true |
f74d5cb8cec7577ba18d9cf39b4840a5c1b130e7 | 7,951 | py | Python | tools/mgms/amp/dlib_face_training.py | AudiovisualMetadataPlatform/amp_mgms | 593d4f4d40b597a7753cd152cd233976e6b28c75 | [
"Apache-2.0"
] | null | null | null | tools/mgms/amp/dlib_face_training.py | AudiovisualMetadataPlatform/amp_mgms | 593d4f4d40b597a7753cd152cd233976e6b28c75 | [
"Apache-2.0"
] | 1 | 2022-02-16T16:21:03.000Z | 2022-02-16T16:21:03.000Z | tools/mgms/amp/dlib_face_training.py | AudiovisualMetadataPlatform/amp_mgms | 593d4f4d40b597a7753cd152cd233976e6b28c75 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import os
import os.path
import traceback
import shutil
import face_recognition
import cv2
import pickle
# from tqdm.notebook import tqdm
from zipfile import ZipFile
import logging
import amp.utils
FR_TRAINED_MODEL_SUFFIX = ".frt"
# Train Face Recognition model with the provided training_phot... | 48.779141 | 162 | 0.690479 |
import os
import os.path
import traceback
import shutil
import face_recognition
import cv2
import pickle
from zipfile import ZipFile
import logging
import amp.utils
FR_TRAINED_MODEL_SUFFIX = ".frt"
def train_faces(training_photos):
# unzip training_photos
facial_dir = get_facial_dir()
photos_dir = unzip... | true | true |
f74d5d7970a4be30e22102dd3533b49bd1d8d9ad | 2,503 | py | Python | tests/integration/authorization/conftest.py | TinkoffCreditSystems/overhave | b0ab705ef5c5c5a65fa0b14b173b64fd7310e187 | [
"Apache-2.0"
] | 33 | 2021-02-01T15:49:37.000Z | 2021-12-20T00:44:43.000Z | tests/integration/authorization/conftest.py | TinkoffCreditSystems/overhave | b0ab705ef5c5c5a65fa0b14b173b64fd7310e187 | [
"Apache-2.0"
] | 46 | 2021-02-03T12:56:52.000Z | 2021-12-19T18:50:27.000Z | tests/integration/authorization/conftest.py | TinkoffCreditSystems/overhave | b0ab705ef5c5c5a65fa0b14b173b64fd7310e187 | [
"Apache-2.0"
] | 1 | 2021-12-07T09:02:44.000Z | 2021-12-07T09:02:44.000Z | from typing import List, cast
import pytest
from faker import Faker
from pydantic import SecretStr
from pytest_mock import MockFixture
from overhave import OverhaveAuthorizationSettings
from overhave.authorization import (
DefaultAdminAuthorizationManager,
LDAPAdminAuthorizationManager,
LDAPAuthenticator,... | 31.683544 | 118 | 0.805833 | from typing import List, cast
import pytest
from faker import Faker
from pydantic import SecretStr
from pytest_mock import MockFixture
from overhave import OverhaveAuthorizationSettings
from overhave.authorization import (
DefaultAdminAuthorizationManager,
LDAPAdminAuthorizationManager,
LDAPAuthenticator,... | true | true |
f74d5dab23d99d5a60e42e345d5d872d925e3993 | 6,058 | py | Python | src/train.py | DequanZhu/facenet | 78f32c2fa43217489f5b340826991780b3276fe2 | [
"MIT"
] | null | null | null | src/train.py | DequanZhu/facenet | 78f32c2fa43217489f5b340826991780b3276fe2 | [
"MIT"
] | null | null | null | src/train.py | DequanZhu/facenet | 78f32c2fa43217489f5b340826991780b3276fe2 | [
"MIT"
] | null | null | null | from __future__ import division
import os
import sys
import numpy as np
import tensorflow as tf
from tensorflow.keras.optimizers import schedules, Adam
from tensorflow.python.keras.losses import SparseCategoricalCrossentropy
from tensorflow.python.keras.metrics import SparseCategoricalAccuracy
from facenet impo... | 51.777778 | 111 | 0.612413 | from __future__ import division
import os
import sys
import numpy as np
import tensorflow as tf
from tensorflow.keras.optimizers import schedules, Adam
from tensorflow.python.keras.losses import SparseCategoricalCrossentropy
from tensorflow.python.keras.metrics import SparseCategoricalAccuracy
from facenet impo... | true | true |
f74d5e3d4b1cc76cfc73f5a32e6d9a6f6ce91f68 | 3,590 | py | Python | telegram_parser/link_generator.py | flexagoon/telegram_parser | 7f0e601c5ba03d48d889fe22561ea702db90e7bd | [
"Apache-2.0"
] | null | null | null | telegram_parser/link_generator.py | flexagoon/telegram_parser | 7f0e601c5ba03d48d889fe22561ea702db90e7bd | [
"Apache-2.0"
] | null | null | null | telegram_parser/link_generator.py | flexagoon/telegram_parser | 7f0e601c5ba03d48d889fe22561ea702db90e7bd | [
"Apache-2.0"
] | null | null | null | import random, string, itertools
def alphabets_generator():
alphabet = ['1', '2', '3','4' , '5', '6', '7', '8', '9', '0', '_']
for letter in range(97,123): #all letters except first alphabet
alphabet.append(chr(letter))
alphabet1 = [] #first letter alpha... | 37.010309 | 140 | 0.587465 | import random, string, itertools
def alphabets_generator():
alphabet = ['1', '2', '3','4' , '5', '6', '7', '8', '9', '0', '_']
for letter in range(97,123): alphabet.append(chr(letter))
alphabet1 = [] for letter in range(97,123):
alphabet1.app... | true | true |
f74d5e4385dd68305852f86531d7d9e586cd4a4b | 2,170 | py | Python | anchors/templatetags/anchors_tags.py | Fantomas42/django-anchors | 1cedc947dd3f1ed5197e55bb96cf0c6d2e2cf430 | [
"BSD-3-Clause"
] | null | null | null | anchors/templatetags/anchors_tags.py | Fantomas42/django-anchors | 1cedc947dd3f1ed5197e55bb96cf0c6d2e2cf430 | [
"BSD-3-Clause"
] | null | null | null | anchors/templatetags/anchors_tags.py | Fantomas42/django-anchors | 1cedc947dd3f1ed5197e55bb96cf0c6d2e2cf430 | [
"BSD-3-Clause"
] | null | null | null | """Template tags for anchors app"""
try:
from urlparse import urlparse
except ImportError: # Python 3
from urllib.parse import urlparse
from bs4 import BeautifulSoup
from django import template
from django.contrib.sites.models import Site
from django.utils.safestring import mark_safe
from django.utils.html i... | 25.529412 | 60 | 0.665438 | try:
from urlparse import urlparse
except ImportError: from urllib.parse import urlparse
from bs4 import BeautifulSoup
from django import template
from django.contrib.sites.models import Site
from django.utils.safestring import mark_safe
from django.utils.html import conditional_escape
register = template.L... | true | true |
f74d5e86ffa8bd639f7c95a9d3aba0c6ad06f680 | 1,710 | py | Python | backend/surveyapi/decorator.py | sunwenquan/iSurvey | bc14a102e56b33fb4b3612b3bef98183f6e46612 | [
"Apache-2.0"
] | null | null | null | backend/surveyapi/decorator.py | sunwenquan/iSurvey | bc14a102e56b33fb4b3612b3bef98183f6e46612 | [
"Apache-2.0"
] | null | null | null | backend/surveyapi/decorator.py | sunwenquan/iSurvey | bc14a102e56b33fb4b3612b3bef98183f6e46612 | [
"Apache-2.0"
] | null | null | null | from functools import wraps
from flask import jsonify,current_app
from flask import request
import jwt
# 对token进行解码可以使用pyJWT
# pyjwt : python 实现的 JSON Web Token:
def token_required(f):
'''
验证前端发来的token信息是否合法,如果不合法,返回错误信息,不支持被装饰的函数f
如果合法,执行被装饰的函数f
'''
@wraps(f)
def __verfy(*args,**kwargs):
... | 27.142857 | 70 | 0.599415 | from functools import wraps
from flask import jsonify,current_app
from flask import request
import jwt
def token_required(f):
@wraps(f)
def __verfy(*args,**kwargs):
auth_headers = request.headers.get('Authorization','').split()
error = {
'message':'非法的token',
... | true | true |
f74d608c45b40907d1dfdb4dba9a26674bcbe86a | 15,381 | py | Python | sklearn/decomposition/tests/test_incremental_pca.py | huzq/scikit-learn | f862129f36786acbae3d9f2d161bbb72d77b87ec | [
"BSD-3-Clause"
] | 1 | 2020-12-03T16:35:55.000Z | 2020-12-03T16:35:55.000Z | sklearn/decomposition/tests/test_incremental_pca.py | huzq/scikit-learn | f862129f36786acbae3d9f2d161bbb72d77b87ec | [
"BSD-3-Clause"
] | 1 | 2022-03-09T19:32:57.000Z | 2022-03-09T20:23:30.000Z | sklearn/decomposition/tests/test_incremental_pca.py | huzq/scikit-learn | f862129f36786acbae3d9f2d161bbb72d77b87ec | [
"BSD-3-Clause"
] | 1 | 2020-02-16T05:40:12.000Z | 2020-02-16T05:40:12.000Z | """Tests for Incremental PCA."""
import numpy as np
import pytest
import warnings
from sklearn.utils._testing import assert_almost_equal
from sklearn.utils._testing import assert_array_almost_equal
from sklearn.utils._testing import assert_allclose_dense_sparse
from numpy.testing import assert_array_equal
from sklear... | 34.028761 | 87 | 0.682205 | import numpy as np
import pytest
import warnings
from sklearn.utils._testing import assert_almost_equal
from sklearn.utils._testing import assert_array_almost_equal
from sklearn.utils._testing import assert_allclose_dense_sparse
from numpy.testing import assert_array_equal
from sklearn import datasets
from sklearn.de... | true | true |
f74d60bc4c744a61cce0eb0a57fda3ed8a29d3ce | 16,510 | py | Python | aa_manager.py | Austerius/AmericanAirlines-scraper | 9848f133d941e715c2a28c8e6ed99440967e908d | [
"BSD-3-Clause"
] | 1 | 2021-05-19T21:10:44.000Z | 2021-05-19T21:10:44.000Z | aa_manager.py | Austerius/AmericanAirlines-scraper | 9848f133d941e715c2a28c8e6ed99440967e908d | [
"BSD-3-Clause"
] | null | null | null | aa_manager.py | Austerius/AmericanAirlines-scraper | 9848f133d941e715c2a28c8e6ed99440967e908d | [
"BSD-3-Clause"
] | 1 | 2020-03-20T14:42:52.000Z | 2020-03-20T14:42:52.000Z | """
Script for running American Airlines scraper directly from command line.
**Requirements**:
- Selenium
- Geckodriver
- Firefox web browser
- bs4 (BeautifulSoup)
Default name for file with search queries -
'search_tasks.json'(default location - script directory).
'search_tasks.json'(and similar files) must have foll... | 46.770538 | 119 | 0.642641 | import json
import re
import datetime
import argparse
from multiprocessing import Pool
from american_airlines import AmericanAirlines
AIRPORTS_CODES = "airports.json" NUM_PROCESSES = 4 SEARCH_TASKS = "search_tasks.json"
def get_airports_codes(airports_file):
with open(airports_file, 'r') as file:
tex... | true | true |
f74d618ffd0980a092c540577b8989c31c36d997 | 20,645 | py | Python | zerver/lib/streams.py | networksneaker/zulip | fae365f8c7e2d6ee041024a22b6ba5a64cbffe4e | [
"Apache-2.0"
] | 6 | 2019-05-09T20:43:20.000Z | 2022-03-29T05:53:50.000Z | zerver/lib/streams.py | networksneaker/zulip | fae365f8c7e2d6ee041024a22b6ba5a64cbffe4e | [
"Apache-2.0"
] | 2 | 2016-10-18T04:01:56.000Z | 2016-10-20T18:19:09.000Z | zerver/lib/streams.py | networksneaker/zulip | fae365f8c7e2d6ee041024a22b6ba5a64cbffe4e | [
"Apache-2.0"
] | 7 | 2016-08-10T02:24:32.000Z | 2022-03-28T15:14:18.000Z | from typing import Any, Iterable, List, Mapping, Optional, Set, Tuple, Union
from django.conf import settings
from django.db.models.query import QuerySet
from django.utils.translation import ugettext as _
from zerver.lib.bugdown import convert as bugdown_convert
from zerver.lib.request import JsonableError
from zerve... | 42.83195 | 109 | 0.675902 | from typing import Any, Iterable, List, Mapping, Optional, Set, Tuple, Union
from django.conf import settings
from django.db.models.query import QuerySet
from django.utils.translation import ugettext as _
from zerver.lib.bugdown import convert as bugdown_convert
from zerver.lib.request import JsonableError
from zerve... | true | true |
f74d62a68c94b285d8ff230d2dfbfa9539b7a73d | 994 | py | Python | google/ads/google_ads/v5/services/extension_feed_item_service_client_config.py | arammaliachi/google-ads-python | a4fe89567bd43eb784410523a6306b5d1dd9ee67 | [
"Apache-2.0"
] | 1 | 2021-04-09T04:28:47.000Z | 2021-04-09T04:28:47.000Z | google/ads/google_ads/v5/services/extension_feed_item_service_client_config.py | arammaliachi/google-ads-python | a4fe89567bd43eb784410523a6306b5d1dd9ee67 | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/v5/services/extension_feed_item_service_client_config.py | arammaliachi/google-ads-python | a4fe89567bd43eb784410523a6306b5d1dd9ee67 | [
"Apache-2.0"
] | null | null | null | config = {
"interfaces": {
"google.ads.googleads.v5.services.ExtensionFeedItemService": {
"retry_codes": {
"idempotent": [
"DEADLINE_EXCEEDED",
"UNAVAILABLE"
],
"non_idempotent": []
},
"retry_params": {
"default": {
"initial_retry_del... | 26.864865 | 66 | 0.540241 | config = {
"interfaces": {
"google.ads.googleads.v5.services.ExtensionFeedItemService": {
"retry_codes": {
"idempotent": [
"DEADLINE_EXCEEDED",
"UNAVAILABLE"
],
"non_idempotent": []
},
"retry_params": {
"default": {
"initial_retry_del... | true | true |
f74d6326782e483fc9072b1fd0a2f0878e741540 | 6,385 | py | Python | huaweicloud-sdk-rms/huaweicloudsdkrms/v1/model/show_resource_history_request.py | githubmilesma/huaweicloud-sdk-python-v3 | 9d9449ed68a609ca65f0aa50b5b2a1c28445bf03 | [
"Apache-2.0"
] | 1 | 2021-04-16T07:59:28.000Z | 2021-04-16T07:59:28.000Z | huaweicloud-sdk-rms/huaweicloudsdkrms/v1/model/show_resource_history_request.py | Lencof/huaweicloud-sdk-python-v3 | d13dc4e2830a83e295be6e4de021999b3376e34e | [
"Apache-2.0"
] | null | null | null | huaweicloud-sdk-rms/huaweicloudsdkrms/v1/model/show_resource_history_request.py | Lencof/huaweicloud-sdk-python-v3 | d13dc4e2830a83e295be6e4de021999b3376e34e | [
"Apache-2.0"
] | 1 | 2022-01-17T02:24:18.000Z | 2022-01-17T02:24:18.000Z | # coding: utf-8
import pprint
import re
import six
class ShowResourceHistoryRequest:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and t... | 27.403433 | 128 | 0.599843 |
import pprint
import re
import six
class ShowResourceHistoryRequest:
sensitive_list = []
openapi_types = {
'resource_id': 'str',
'marker': 'str',
'limit': 'int',
'earlier_time': 'int',
'later_time': 'int',
'chronological_order': 'str'
}
attribu... | true | true |
f74d6344a493cc316682668d5e9e49a1c0ae30c1 | 19,933 | py | Python | graph-to-graph/conflict.py | mbrcknl/graph-refine | 78c74f18127db53606f18f775a5a50de86bc6b97 | [
"BSD-2-Clause",
"MIT"
] | 6 | 2017-03-17T17:57:48.000Z | 2019-12-28T13:03:23.000Z | graph-to-graph/conflict.py | myuluo/graph-refine | 8924af0c61c3c863db7957e0ebac7ae1ceefad9d | [
"BSD-2-Clause",
"MIT"
] | 3 | 2020-04-07T09:15:55.000Z | 2022-03-23T01:36:26.000Z | graph-to-graph/conflict.py | myuluo/graph-refine | 8924af0c61c3c863db7957e0ebac7ae1ceefad9d | [
"BSD-2-Clause",
"MIT"
] | 7 | 2020-04-16T00:32:41.000Z | 2022-03-09T05:25:23.000Z | #!/usr/bin/env python
#
#
# Copyright 2020, Data61, CSIRO (ABN 41 687 119 230)
#
# SPDX-License-Identifier: BSD-2-Clause
#
import os, re, sys, copy
from subprocess import Popen, PIPE
from elf_correlate import immFunc
from elf_file import elfFile
from addr_utils import callNodes,phyAddrP
import bench
import cplex
impor... | 35.980144 | 230 | 0.572367 |
import os, re, sys, copy
from subprocess import Popen, PIPE
from elf_correlate import immFunc
from elf_file import elfFile
from addr_utils import callNodes,phyAddrP
import bench
import cplex
import graph_refine.trace_refute as trace_refute
import convert_loop_bounds
from graph_refine.trace_refute import parse_num_arro... | false | true |
f74d63df5d6e6e6b42091b36ab139166b0f40f04 | 98 | py | Python | 4_factory/abstract_factory/onion.py | hypersport/Head-First-Design-Patterns-Python | 0c8b831ae89ebbbef8b203b96508deb7e3063590 | [
"MIT"
] | null | null | null | 4_factory/abstract_factory/onion.py | hypersport/Head-First-Design-Patterns-Python | 0c8b831ae89ebbbef8b203b96508deb7e3063590 | [
"MIT"
] | null | null | null | 4_factory/abstract_factory/onion.py | hypersport/Head-First-Design-Patterns-Python | 0c8b831ae89ebbbef8b203b96508deb7e3063590 | [
"MIT"
] | null | null | null | from veggies import Veggies
class Onion(Veggies):
def __str__(self):
return 'Onion'
| 14 | 27 | 0.673469 | from veggies import Veggies
class Onion(Veggies):
def __str__(self):
return 'Onion'
| true | true |
f74d63f3c7385bbdfaf0ad61fa9f4262b3e9ac71 | 1,192 | py | Python | vectors/katparser.py | imachug/pysha3 | d0d4a1d35bb7a99630b32755ba826d821e5b0877 | [
"PSF-2.0"
] | 30 | 2016-05-06T18:10:44.000Z | 2021-10-21T00:52:37.000Z | vectors/katparser.py | imachug/pysha3 | d0d4a1d35bb7a99630b32755ba826d821e5b0877 | [
"PSF-2.0"
] | 21 | 2017-01-05T09:21:45.000Z | 2021-10-18T23:28:15.000Z | vectors/katparser.py | imachug/pysha3 | d0d4a1d35bb7a99630b32755ba826d821e5b0877 | [
"PSF-2.0"
] | 19 | 2016-06-15T15:37:18.000Z | 2022-01-11T09:34:37.000Z | #!/usr/bin/env python3
import glob
def katparser(katfile):
"""Trivial parser for KAT files
"""
length = msg = md = None
with open(katfile) as f:
for line in f:
line = line.strip()
if not line or line.startswith("#"):
continue
key, value = lin... | 27.72093 | 66 | 0.442953 | import glob
def katparser(katfile):
length = msg = md = None
with open(katfile) as f:
for line in f:
line = line.strip()
if not line or line.startswith("#"):
continue
key, value = line.split(" = ")
if key == "Len":
length ... | true | true |
f74d67ef8c299e0ce0d62a57d2f99d988ec98495 | 5,892 | py | Python | radar/Amazon Weather Program.py | EVS-ATMOS/precipitation-onset | 3c9cf010b5246d17fae2796d271f6a8be892efb1 | [
"BSD-2-Clause"
] | null | null | null | radar/Amazon Weather Program.py | EVS-ATMOS/precipitation-onset | 3c9cf010b5246d17fae2796d271f6a8be892efb1 | [
"BSD-2-Clause"
] | null | null | null | radar/Amazon Weather Program.py | EVS-ATMOS/precipitation-onset | 3c9cf010b5246d17fae2796d271f6a8be892efb1 | [
"BSD-2-Clause"
] | 5 | 2018-06-06T17:02:08.000Z | 2020-09-27T17:20:46.000Z | import boto
from boto.s3.connection import S3Connection
from datetime import timedelta, datetime
import os
import pyart
from matplotlib import pyplot as plt
import tempfile
import numpy as np
import cartopy
def _nearestDate(dates, pivot):
return min(dates, key=lambda x: abs(x - pivot))
def get_radar_from_aws(si... | 34.255814 | 97 | 0.62831 | import boto
from boto.s3.connection import S3Connection
from datetime import timedelta, datetime
import os
import pyart
from matplotlib import pyplot as plt
import tempfile
import numpy as np
import cartopy
def _nearestDate(dates, pivot):
return min(dates, key=lambda x: abs(x - pivot))
def get_radar_from_aws(si... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.