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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
08efe153c2377456ed8951babe8ed0affc8b4baa | 12,976 | py | Python | ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/routerange_6a711ea3d742cb807a3c457876b38c5b.py | rfrye-github/ixnetwork_restpy | 23eeb24b21568a23d3f31bbd72814ff55eb1af44 | [
"MIT"
] | null | null | null | ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/routerange_6a711ea3d742cb807a3c457876b38c5b.py | rfrye-github/ixnetwork_restpy | 23eeb24b21568a23d3f31bbd72814ff55eb1af44 | [
"MIT"
] | null | null | null | ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/routerange_6a711ea3d742cb807a3c457876b38c5b.py | rfrye-github/ixnetwork_restpy | 23eeb24b21568a23d3f31bbd72814ff55eb1af44 | [
"MIT"
] | null | null | null | # MIT LICENSE
#
# Copyright 1997 - 2020 by IXIA Keysight
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, ... | 53.180328 | 328 | 0.67648 | from ixnetwork_restpy.base import Base
from ixnetwork_restpy.files import Files
class RouteRange(Base):
__slots__ = ()
_SDM_NAME = 'routeRange'
_SDM_ATT_MAP = {
'Enabled': 'enabled',
'FirstRoute': 'firstRoute',
'MaskWidth': 'maskWidth',
'Metric': 'metric',
... | true | true |
08efe160289bacba2b832cb0784e503b76b5e68d | 16,041 | py | Python | third_party/scons/scons-local/SCons/Job.py | rwatson/chromium-capsicum | b03da8e897f897c6ad2cda03ceda217b760fd528 | [
"BSD-3-Clause"
] | 11 | 2015-03-20T04:08:08.000Z | 2021-11-15T15:51:36.000Z | third_party/scons/scons-local/SCons/Job.py | changbai1980/chromium | c4625eefca763df86471d798ee5a4a054b4716ae | [
"BSD-3-Clause"
] | null | null | null | third_party/scons/scons-local/SCons/Job.py | changbai1980/chromium | c4625eefca763df86471d798ee5a4a054b4716ae | [
"BSD-3-Clause"
] | null | null | null | """SCons.Job
This module defines the Serial and Parallel classes that execute tasks to
complete a build. The Jobs class provides a higher level interface to start,
stop, and wait on jobs.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
#
# Permission is hereby granted,... | 37.304651 | 98 | 0.577832 | """SCons.Job
This module defines the Serial and Parallel classes that execute tasks to
complete a build. The Jobs class provides a higher level interface to start,
stop, and wait on jobs.
"""
__revision__ = "src/engine/SCons/Job.py 3897 2009/01/13 06:45:54 scons"
import os
import signal
import SCons.Errors
expl... | false | true |
08efe193c99f354f28b594d87af2b12fcc18e4c7 | 2,500 | py | Python | short/cli.py | timothycrosley/short | dcf25ec01b5406d9e0a35ac7dd8112239c0912a5 | [
"MIT"
] | null | null | null | short/cli.py | timothycrosley/short | dcf25ec01b5406d9e0a35ac7dd8112239c0912a5 | [
"MIT"
] | null | null | null | short/cli.py | timothycrosley/short | dcf25ec01b5406d9e0a35ac7dd8112239c0912a5 | [
"MIT"
] | null | null | null | import os
import sys
import hug
from short._version import current
from short.compile import text
INTRO = """
/##########################################################\
__ ; `.' :
| +. : ; : __
.-+\\ `: ; ,,-' : SHORT
`. `. `\\ ; :' ,'
,-+`+. `... | 33.783784 | 116 | 0.4492 | import os
import sys
import hug
from short._version import current
from short.compile import text
INTRO = """
/##########################################################\
__ ; `.' :
| +. : ; : __
.-+\\ `: ; ,,-' : SHORT
`. `. `\\ ; :' ,'
,-+`+. `... | true | true |
08efe389ac0672cea3b28764523d974666d60e13 | 707 | py | Python | apps/store/migrations/0023_cat.py | lucasjaroszewski/Due-Gatti | e6ade041f23454b490661261af11bc065db80b54 | [
"MIT"
] | null | null | null | apps/store/migrations/0023_cat.py | lucasjaroszewski/Due-Gatti | e6ade041f23454b490661261af11bc065db80b54 | [
"MIT"
] | null | null | null | apps/store/migrations/0023_cat.py | lucasjaroszewski/Due-Gatti | e6ade041f23454b490661261af11bc065db80b54 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.3 on 2021-02-08 20:30
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('store', '0022_auto_20210115_1521'),
]
operations = [
migrations.CreateModel(
name='Cat',
fields=[
('... | 30.73913 | 114 | 0.585573 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('store', '0022_auto_20210115_1521'),
]
operations = [
migrations.CreateModel(
name='Cat',
fields=[
('id', models.AutoField(auto_created=True, primary... | true | true |
08efe3e1376a24b133cc96aa9be35578d1329ee1 | 63 | py | Python | tag/__init__.py | ohahlev/ahlev-django-tag | acd644b4c40f63de4a3680ff02f7f7a2848ff28c | [
"BSD-3-Clause"
] | null | null | null | tag/__init__.py | ohahlev/ahlev-django-tag | acd644b4c40f63de4a3680ff02f7f7a2848ff28c | [
"BSD-3-Clause"
] | null | null | null | tag/__init__.py | ohahlev/ahlev-django-tag | acd644b4c40f63de4a3680ff02f7f7a2848ff28c | [
"BSD-3-Clause"
] | null | null | null | __version__ = '0.0.1'
default_app_config = 'tag.apps.TagConfig' | 31.5 | 41 | 0.761905 | __version__ = '0.0.1'
default_app_config = 'tag.apps.TagConfig' | true | true |
08efe466d8697cb8d250fcc20c6efc4da71aab57 | 219 | py | Python | aulaszeus/admin/__init__.py | zerossB/aulas_zeus | 002fc29578aed3aa36a9b400882e638b68c123ea | [
"BSD-3-Clause"
] | null | null | null | aulaszeus/admin/__init__.py | zerossB/aulas_zeus | 002fc29578aed3aa36a9b400882e638b68c123ea | [
"BSD-3-Clause"
] | null | null | null | aulaszeus/admin/__init__.py | zerossB/aulas_zeus | 002fc29578aed3aa36a9b400882e638b68c123ea | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
aulaszeus.admin
~~~~~~~~~~~~~~~~~~~~~
aulaszeus admin module
:copyright: (c) 2016 by Haynesss.
:license: BSD, see LICENSE for more details.
"""
from . import controllers | 19.909091 | 48 | 0.561644 | from . import controllers | true | true |
08efe4a9e7ebc2518ff845b7030ba0fac1ce707e | 2,305 | py | Python | app/core/tests/test_models.py | jenn0pal/recipe-app-api | 16da3a3920ef9be003f06ba7eebdb6acfd092bed | [
"MIT"
] | null | null | null | app/core/tests/test_models.py | jenn0pal/recipe-app-api | 16da3a3920ef9be003f06ba7eebdb6acfd092bed | [
"MIT"
] | null | null | null | app/core/tests/test_models.py | jenn0pal/recipe-app-api | 16da3a3920ef9be003f06ba7eebdb6acfd092bed | [
"MIT"
] | null | null | null | from django.test import TestCase
from django.contrib.auth import get_user_model
from core import models
def sample_user(email='me@jenn0pal.com', password='p@ssw0rd'):
"""Create a sample user"""
return get_user_model().objects.create_user(email, password)
class ModelTests(TestCase):
def test_create_use... | 30.328947 | 70 | 0.632104 | from django.test import TestCase
from django.contrib.auth import get_user_model
from core import models
def sample_user(email='me@jenn0pal.com', password='p@ssw0rd'):
return get_user_model().objects.create_user(email, password)
class ModelTests(TestCase):
def test_create_user_with_email_successful(self):
... | true | true |
08efe537274d7122e9f47514fb86026d82c84e1f | 3,350 | py | Python | 2015/python/src/day6.py | johncoleman83/aoc-solutions | 0c8c09a9fc94af0722e028a24e4795bba8f952ce | [
"MIT"
] | 1 | 2018-12-06T06:15:59.000Z | 2018-12-06T06:15:59.000Z | 2015/python/src/day6.py | johncoleman83/aoc-solutions | 0c8c09a9fc94af0722e028a24e4795bba8f952ce | [
"MIT"
] | null | null | null | 2015/python/src/day6.py | johncoleman83/aoc-solutions | 0c8c09a9fc94af0722e028a24e4795bba8f952ce | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
Advent of Code 2015: Day #
toggle 936,774 through 937,775
turn off 116,843 through 533,934
turn on 950,906 through 986,993
"""
import os
from shared.readdayinput import readdayinput
class GridLights(object):
def __init__(self, v2 = False):
self.v2 = v2
self.grid = self.m... | 27.235772 | 93 | 0.605075 | import os
from shared.readdayinput import readdayinput
class GridLights(object):
def __init__(self, v2 = False):
self.v2 = v2
self.grid = self.make_grid()
self.TASK_TO_FUNC = {
'on': self.turn_on,
'off': self.turn_off,
'toggle': self.toggle,
... | true | true |
08efe56e199786c34f19247fb709737c2566de50 | 259 | py | Python | test/test1007.py | letolabs/fontforge | 719e5b5fab1384ce625306146daf5c709d625d30 | [
"BSD-3-Clause"
] | 2 | 2015-05-15T16:19:41.000Z | 2017-09-26T10:21:41.000Z | test/test1007.py | Distrotech/fontforge | dc5514f4d56ea523d0677cc77d0ad6ff822363f8 | [
"BSD-3-Clause"
] | null | null | null | test/test1007.py | Distrotech/fontforge | dc5514f4d56ea523d0677cc77d0ad6ff822363f8 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/local/bin/fontforge
#Needs: fonts/ayn+meem.init.svg
# At one point splinestroke failed if the first spline on a contour had a length of 0
import fontforge;
font=fontforge.font();
a = font.createChar(65);
a.importOutlines("fonts/ayn+meem.init.svg");
| 23.545455 | 85 | 0.749035 |
import fontforge;
font=fontforge.font();
a = font.createChar(65);
a.importOutlines("fonts/ayn+meem.init.svg");
| true | true |
08efe594599f8f33199531eab91f4669cb358ed2 | 505 | py | Python | test/fixtures.py | jisaacstone/odata-py | 20b46341dc55999b737cef8acbaa75c4ec4bbd16 | [
"MIT"
] | 3 | 2015-01-14T12:00:09.000Z | 2021-02-21T08:43:15.000Z | test/fixtures.py | jisaacstone/odata-py | 20b46341dc55999b737cef8acbaa75c4ec4bbd16 | [
"MIT"
] | 1 | 2021-02-21T08:43:07.000Z | 2021-02-22T06:08:32.000Z | test/fixtures.py | jisaacstone/odata-py | 20b46341dc55999b737cef8acbaa75c4ec4bbd16 | [
"MIT"
] | 2 | 2016-12-17T06:07:29.000Z | 2021-02-20T11:07:59.000Z | from sqlalchemy import Table, Column, Integer, String, MetaData, ForeignKey
# Table Defs
metadata = MetaData()
users = Table(
'users', metadata,
Column('id', Integer, primary_key=True),
Column('name', String),
Column('fullname', String),
)
addresses = Table(
'addresses', metadata,
Column('id',... | 25.25 | 75 | 0.687129 | from sqlalchemy import Table, Column, Integer, String, MetaData, ForeignKey
metadata = MetaData()
users = Table(
'users', metadata,
Column('id', Integer, primary_key=True),
Column('name', String),
Column('fullname', String),
)
addresses = Table(
'addresses', metadata,
Column('id', Integer, pri... | true | true |
08efe660bc9b063b72619b01ac9530ba53983d1d | 1,168 | py | Python | httpie/plugins/builtin.py | gmanika/httpie | f5904d92c390d96dfb41b80e118d8adc8abb809d | [
"BSD-3-Clause"
] | 2 | 2015-06-27T05:40:27.000Z | 2015-06-27T11:55:23.000Z | httpie/plugins/builtin.py | 915546302/httpie | ca36f1de04310de644857ebbea9c94984971ab7c | [
"BSD-3-Clause"
] | null | null | null | httpie/plugins/builtin.py | 915546302/httpie | ca36f1de04310de644857ebbea9c94984971ab7c | [
"BSD-3-Clause"
] | null | null | null | from base64 import b64encode
import requests.auth
from httpie.plugins.base import AuthPlugin
class BuiltinAuthPlugin(AuthPlugin):
package_name = '(builtin)'
class HTTPBasicAuth(requests.auth.HTTPBasicAuth):
def __call__(self, r):
"""
Override username/password serialization to allow unic... | 23.836735 | 78 | 0.679795 | from base64 import b64encode
import requests.auth
from httpie.plugins.base import AuthPlugin
class BuiltinAuthPlugin(AuthPlugin):
package_name = '(builtin)'
class HTTPBasicAuth(requests.auth.HTTPBasicAuth):
def __call__(self, r):
r.headers['Authorization'] = type(self).make_header(
s... | true | true |
08efe8769a6ef43a8d0454692bdda6e192454c6a | 8,604 | py | Python | nox.py | arbatovdan/new | f36d2bf4846061ea22b35775c8074bcd5bec3788 | [
"Apache-2.0"
] | 1 | 2021-02-03T15:49:06.000Z | 2021-02-03T15:49:06.000Z | nox.py | Acidburn0zzz/python-docs-samples | bc0924a6826cbdb669415b58fd5b2d8534d87aa1 | [
"Apache-2.0"
] | null | null | null | nox.py | Acidburn0zzz/python-docs-samples | bc0924a6826cbdb669415b58fd5b2d8534d87aa1 | [
"Apache-2.0"
] | 1 | 2021-02-03T15:48:54.000Z | 2021-02-03T15:48:54.000Z | # Copyright 2016 Google 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 required by applicable law or ... | 30.510638 | 79 | 0.68596 |
from __future__ import print_function
import fnmatch
import os
import tempfile
import nox
try:
import ci_diff_helper
except ImportError:
ci_diff_helper = None
def _list_files(folder, pattern):
for root, folders, files in os.walk(folder):
for filename in files:
if fnmatch.fnmatch(f... | true | true |
08efe87e7a518b5abde407e648b1e0a91acf2ba2 | 903 | py | Python | setup.py | emlid/ntripbrowser | da14714ca0fe94aae7fe7f49ccf6e4a04ada644b | [
"BSD-3-Clause"
] | 24 | 2017-05-11T04:16:01.000Z | 2021-12-13T16:45:10.000Z | setup.py | emlid/ntripbrowser | da14714ca0fe94aae7fe7f49ccf6e4a04ada644b | [
"BSD-3-Clause"
] | 3 | 2019-08-15T11:17:32.000Z | 2021-07-01T14:59:39.000Z | setup.py | emlid/ntripbrowser | da14714ca0fe94aae7fe7f49ccf6e4a04ada644b | [
"BSD-3-Clause"
] | 6 | 2017-04-20T14:03:05.000Z | 2021-12-13T12:10:01.000Z | from setuptools import setup
from os import path
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md')) as f:
readme = f.read()
setup(
name='ntripbrowser',
version='3.0.0',
author='Andrew Yushkevich, Alexander Yashin',
author_email='andrew.yushkevic... | 33.444444 | 112 | 0.676633 | from setuptools import setup
from os import path
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md')) as f:
readme = f.read()
setup(
name='ntripbrowser',
version='3.0.0',
author='Andrew Yushkevich, Alexander Yashin',
author_email='andrew.yushkevic... | true | true |
08efe8f5df867bb6d7c03d188a428bfcefe793d4 | 27,853 | py | Python | scanpy/tools/_rank_genes_groups.py | ChenddatHKU/scanpy | 1b290be6fd297023a0bd705e66f69254c1626fc4 | [
"BSD-3-Clause"
] | null | null | null | scanpy/tools/_rank_genes_groups.py | ChenddatHKU/scanpy | 1b290be6fd297023a0bd705e66f69254c1626fc4 | [
"BSD-3-Clause"
] | 1 | 2020-06-16T17:14:45.000Z | 2020-06-16T17:14:45.000Z | scanpy/tools/_rank_genes_groups.py | ChenddatHKU/scanpy | 1b290be6fd297023a0bd705e66f69254c1626fc4 | [
"BSD-3-Clause"
] | 2 | 2020-06-16T16:42:40.000Z | 2020-08-28T16:59:42.000Z | """Rank genes according to differential expression.
"""
from math import floor
from typing import Iterable, Union, Optional
import numpy as np
import pandas as pd
from anndata import AnnData
from scipy.sparse import issparse, vstack
from .. import _utils
from .. import logging as logg
from ..preprocessing._simple imp... | 36.125811 | 131 | 0.599756 | from math import floor
from typing import Iterable, Union, Optional
import numpy as np
import pandas as pd
from anndata import AnnData
from scipy.sparse import issparse, vstack
from .. import _utils
from .. import logging as logg
from ..preprocessing._simple import _get_mean_var
from .._compat import Literal
_Metho... | true | true |
08efe95e9ee6c74a4e32adf4efe3df42b067387d | 2,085 | py | Python | docs/conf.py | tomfrankkirk/regtools | 844fb1f108aa7dd02e8b9d36a2975022bce2c98d | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | tomfrankkirk/regtools | 844fb1f108aa7dd02e8b9d36a2975022bce2c98d | [
"BSD-3-Clause"
] | 2 | 2020-11-07T12:16:11.000Z | 2020-11-23T19:15:45.000Z | docs/conf.py | tomfrankkirk/regtricks | 0a8a6693dea86b4d37f32f4fd0eea6807280c18b | [
"BSD-3-Clause"
] | null | null | null | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 34.180328 | 79 | 0.669544 |
import os
import sys
sys.path.insert(1, '..')
from setup import get_version
project = 'Regtricks'
copyright = '2020, Tom Kirk'
author = 'Tom Kirk'
release = get_version()
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.napoleon',
'recommonmark',
'sphinx.ext.autosectionlabel'
]
templates_path =... | true | true |
08efe9a769cf9287fb5514bee839cfcef4a8c918 | 19,584 | py | Python | djangoappengine/tests/filter.py | aprefontaine/TMScheduler | 298a332532b9df1d3f6a80b1334630bc106d3b78 | [
"BSD-3-Clause"
] | 1 | 2015-08-30T16:48:17.000Z | 2015-08-30T16:48:17.000Z | tests/filter.py | aprefontaine/TMScheduler | 298a332532b9df1d3f6a80b1334630bc106d3b78 | [
"BSD-3-Clause"
] | null | null | null | tests/filter.py | aprefontaine/TMScheduler | 298a332532b9df1d3f6a80b1334630bc106d3b78 | [
"BSD-3-Clause"
] | null | null | null | from .testmodels import FieldsWithOptionsModel, EmailModel, DateTimeModel, OrderedModel
import datetime, time
from django.test import TestCase
from django.db.models import Q
from django.db.utils import DatabaseError
class FilterTest(TestCase):
floats = [5.3, 2.6, 9.1, 1.58]
emails = ['app-engine@scholardocs.co... | 47.882641 | 93 | 0.552645 | from .testmodels import FieldsWithOptionsModel, EmailModel, DateTimeModel, OrderedModel
import datetime, time
from django.test import TestCase
from django.db.models import Q
from django.db.utils import DatabaseError
class FilterTest(TestCase):
floats = [5.3, 2.6, 9.1, 1.58]
emails = ['app-engine@scholardocs.co... | true | true |
08efe9f47e256213c271288f727b8272b79b316f | 368 | py | Python | seligimus/iteration/head.py | AustinScola/seligimus | 206654fd8cf5e9b9a9da25439ccde2efe5a6cc7a | [
"MIT"
] | 1 | 2021-01-30T15:57:40.000Z | 2021-01-30T15:57:40.000Z | seligimus/iteration/head.py | AustinScola/seligimus | 206654fd8cf5e9b9a9da25439ccde2efe5a6cc7a | [
"MIT"
] | 100 | 2021-01-30T16:01:46.000Z | 2021-07-24T14:00:04.000Z | seligimus/iteration/head.py | AustinScola/seligimus | 206654fd8cf5e9b9a9da25439ccde2efe5a6cc7a | [
"MIT"
] | null | null | null | """The first item in an iterable."""
from typing import Any, Iterable
from seligimus.exceptions.iteration.no_head import NoHead
def head(iterable: Iterable) -> Any:
"""Return the first item in an iterable."""
try:
return next(iter(iterable))
except StopIteration as stop_iteration_exception:
... | 28.307692 | 57 | 0.725543 | from typing import Any, Iterable
from seligimus.exceptions.iteration.no_head import NoHead
def head(iterable: Iterable) -> Any:
try:
return next(iter(iterable))
except StopIteration as stop_iteration_exception:
raise NoHead() from stop_iteration_exception
| true | true |
08efea49b5281c4a67ad571de78f131c46f65ea7 | 8,941 | py | Python | test/test_PhraseQuery.py | rudimeier/pylucene | 4cc2dd57170c27085f3ff8ad22e179f977097f3e | [
"Apache-2.0"
] | 5 | 2017-03-17T04:35:39.000Z | 2021-04-06T07:20:04.000Z | test/test_PhraseQuery.py | rudimeier/pylucene | 4cc2dd57170c27085f3ff8ad22e179f977097f3e | [
"Apache-2.0"
] | null | null | null | test/test_PhraseQuery.py | rudimeier/pylucene | 4cc2dd57170c27085f3ff8ad22e179f977097f3e | [
"Apache-2.0"
] | 1 | 2018-02-19T13:17:14.000Z | 2018-02-19T13:17:14.000Z | # ====================================================================
# 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 re... | 36.643443 | 85 | 0.632368 |
import sys, lucene, unittest
from PyLuceneTestCase import PyLuceneTestCase
from org.apache.lucene.analysis import Analyzer
from org.apache.lucene.analysis.core import LowerCaseTokenizer, StopAnalyzer
from org.apache.lucene.analysis.tokenattributes import CharTermAttribute
from org.apache.lucene.document import Docume... | true | true |
08efeb8e6faf466bbe44722a72215f88842e9bd8 | 4,904 | py | Python | bioviz/seqLogo.py | BioWiz/msa | 634a99b2a36393dbec75ff008997de0ebd6cb2cb | [
"BSD-3-Clause"
] | 1 | 2021-04-01T05:50:44.000Z | 2021-04-01T05:50:44.000Z | bioviz/seqLogo.py | BioWiz/msa | 634a99b2a36393dbec75ff008997de0ebd6cb2cb | [
"BSD-3-Clause"
] | null | null | null | bioviz/seqLogo.py | BioWiz/msa | 634a99b2a36393dbec75ff008997de0ebd6cb2cb | [
"BSD-3-Clause"
] | null | null | null | import math
from bioviz import colorMaps, utils
from bokeh.io import output_file, show, save
from bokeh.io.export import export_png, export_svg
from bokeh.models import ColumnDataSource, Plot, LinearAxis, Grid, Range1d
from bokeh.models.glyphs import ImageURL, Image
from bokeh.layouts import column
from datetime import... | 42.643478 | 149 | 0.559135 | import math
from bioviz import colorMaps, utils
from bokeh.io import output_file, show, save
from bokeh.io.export import export_png, export_svg
from bokeh.models import ColumnDataSource, Plot, LinearAxis, Grid, Range1d
from bokeh.models.glyphs import ImageURL, Image
from bokeh.layouts import column
from datetime import... | true | true |
08efede398c14248444313a8e04276e0b570484c | 444 | py | Python | database.py | Khantanjil/Interactive-Dictionarity | d8a206392b5de8bbfdb7e9d93b6f18a6b1fa21ee | [
"MIT"
] | null | null | null | database.py | Khantanjil/Interactive-Dictionarity | d8a206392b5de8bbfdb7e9d93b6f18a6b1fa21ee | [
"MIT"
] | null | null | null | database.py | Khantanjil/Interactive-Dictionarity | d8a206392b5de8bbfdb7e9d93b6f18a6b1fa21ee | [
"MIT"
] | null | null | null | import mysql.connector
conn = mysql.connector.connect(
user="ardit700_student",
password="ardit700_student",
host="108.167.140.122",
database="ardit700_pm1database"
)
cursor = conn.cursor()
word = input("Enter a word: ")
query = cursor.execute(f"SELECT * FROM Dictionary WHERE Expression = '{word}'")
r... | 24.666667 | 79 | 0.689189 | import mysql.connector
conn = mysql.connector.connect(
user="ardit700_student",
password="ardit700_student",
host="108.167.140.122",
database="ardit700_pm1database"
)
cursor = conn.cursor()
word = input("Enter a word: ")
query = cursor.execute(f"SELECT * FROM Dictionary WHERE Expression = '{word}'")
r... | true | true |
08efedf403b4401542e5bc17d171889519b24936 | 12,781 | py | Python | tests/test_upstream_suite.py | otovo/python-sanity-html | e445dd9d0f05f8cfe424112e568f37c36e663096 | [
"Apache-2.0"
] | 13 | 2021-04-14T11:19:20.000Z | 2021-11-26T11:56:39.000Z | tests/test_upstream_suite.py | otovo/python-sanity-html | e445dd9d0f05f8cfe424112e568f37c36e663096 | [
"Apache-2.0"
] | 25 | 2021-04-14T12:48:50.000Z | 2021-11-29T08:11:14.000Z | tests/test_upstream_suite.py | otovo/python-portabletext-html | 31718a70db58afd143976bf0edfb42239f1800dc | [
"Apache-2.0"
] | null | null | null | import json
import re
from pathlib import Path
from typing import Optional, Type
import pytest
from portabletext_html import render
from portabletext_html.marker_definitions import LinkMarkerDefinition, MarkerDefinition
from portabletext_html.renderer import PortableTextRenderer
from portabletext_html.types import Bl... | 36.413105 | 103 | 0.722713 | import json
import re
from pathlib import Path
from typing import Optional, Type
import pytest
from portabletext_html import render
from portabletext_html.marker_definitions import LinkMarkerDefinition, MarkerDefinition
from portabletext_html.renderer import PortableTextRenderer
from portabletext_html.types import Bl... | true | true |
08efee3ac8e88ee6f860a4ad71d1fd1f1e46cb88 | 9,698 | py | Python | nemo/collections/nlp/models/language_modeling/bert_lm_model.py | dynasty-com/NeMo | 1ac828df423fbcec1b34c650b3a20266bb133dde | [
"Apache-2.0"
] | null | null | null | nemo/collections/nlp/models/language_modeling/bert_lm_model.py | dynasty-com/NeMo | 1ac828df423fbcec1b34c650b3a20266bb133dde | [
"Apache-2.0"
] | null | null | null | nemo/collections/nlp/models/language_modeling/bert_lm_model.py | dynasty-com/NeMo | 1ac828df423fbcec1b34c650b3a20266bb133dde | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020, NVIDIA CORPORATION. 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... | 39.104839 | 119 | 0.679109 |
import os
from typing import Dict, Optional
import torch
from omegaconf import DictConfig, OmegaConf
from pytorch_lightning import Trainer
from torch.utils.data import DataLoader
from nemo.collections.common.losses import AggregatorLoss, CrossEntropyLoss, SmoothedCrossEntropyLoss
from nemo.collections.nlp.data.langu... | true | true |
08efee3f496073b79503fcde637285f5b50de643 | 606 | py | Python | pymltools/tf_utils/dataset_file_utils.py | frkhit/pymltools | 4542c2d60af874d07ebfe84cc18661a6c9cbf992 | [
"MIT"
] | null | null | null | pymltools/tf_utils/dataset_file_utils.py | frkhit/pymltools | 4542c2d60af874d07ebfe84cc18661a6c9cbf992 | [
"MIT"
] | null | null | null | pymltools/tf_utils/dataset_file_utils.py | frkhit/pymltools | 4542c2d60af874d07ebfe84cc18661a6c9cbf992 | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
from __future__ import absolute_import
import h5py
def load_data_from_h5file(h5_file, key_list):
with h5py.File(h5_file, 'r') as h5f:
return [h5f[key][:] for key in key_list]
def store_data_in_h5file(h5_file, data_list, key_list):
"""
Args:
h5_file:
data_... | 20.896552 | 59 | 0.646865 | from __future__ import absolute_import
import h5py
def load_data_from_h5file(h5_file, key_list):
with h5py.File(h5_file, 'r') as h5f:
return [h5f[key][:] for key in key_list]
def store_data_in_h5file(h5_file, data_list, key_list):
with h5py.File(h5_file, "w") as h5f:
for index, data in enum... | true | true |
08efee83320fba36c5e983919ee194bee1818c29 | 214 | py | Python | src/solsim/constant.py | cavaunpeu/solsim | da072fdb872248d64eb827d092793cec301fa3aa | [
"MIT"
] | 12 | 2022-01-26T13:31:28.000Z | 2022-02-18T22:28:45.000Z | src/solsim/constant.py | cavaunpeu/solsim | da072fdb872248d64eb827d092793cec301fa3aa | [
"MIT"
] | null | null | null | src/solsim/constant.py | cavaunpeu/solsim | da072fdb872248d64eb827d092793cec301fa3aa | [
"MIT"
] | 1 | 2022-02-17T18:08:59.000Z | 2022-02-17T18:08:59.000Z | from spl.token.constants import TOKEN_PROGRAM_ID, ASSOCIATED_TOKEN_PROGRAM_ID # noqa: F401
from solana.system_program import SYS_PROGRAM_ID # noqa: F401
from solana.sysvar import SYSVAR_RENT_PUBKEY # noqa: F401
| 53.5 | 91 | 0.831776 | from spl.token.constants import TOKEN_PROGRAM_ID, ASSOCIATED_TOKEN_PROGRAM_ID from solana.system_program import SYS_PROGRAM_ID from solana.sysvar import SYSVAR_RENT_PUBKEY | true | true |
08efeff1de865af9ab4a8f08fe438929fb0a9876 | 42 | py | Python | packaging_tutorial/example_pkg/hello_module.py | HFM3/pypi-template | d9407c0171f48dd35c06598600f6299850ea69a2 | [
"Unlicense"
] | null | null | null | packaging_tutorial/example_pkg/hello_module.py | HFM3/pypi-template | d9407c0171f48dd35c06598600f6299850ea69a2 | [
"Unlicense"
] | null | null | null | packaging_tutorial/example_pkg/hello_module.py | HFM3/pypi-template | d9407c0171f48dd35c06598600f6299850ea69a2 | [
"Unlicense"
] | null | null | null | def hello_function():
print('HELLO!')
| 14 | 21 | 0.642857 | def hello_function():
print('HELLO!')
| true | true |
08eff04d008f96d4c94cb00ae58333fc7f9ecdb0 | 3,873 | py | Python | neural_network_circular_gol/optimizers.py | shakedmanes/neural-net-circular-gol | 317a3ef2d52508d86c0118b235b794f1ac6d3717 | [
"MIT"
] | null | null | null | neural_network_circular_gol/optimizers.py | shakedmanes/neural-net-circular-gol | 317a3ef2d52508d86c0118b235b794f1ac6d3717 | [
"MIT"
] | null | null | null | neural_network_circular_gol/optimizers.py | shakedmanes/neural-net-circular-gol | 317a3ef2d52508d86c0118b235b794f1ac6d3717 | [
"MIT"
] | null | null | null | import numpy as np
# Adam optimizer
class OptimizerADAM:
"""
Adaptive Momentum Stochastic Gradient Decent Optimizer.
"""
def __init__(
self,
learning_rate=0.001,
decay=0.,
epsilon=1e-7,
beta_1=0.9,
beta_2=0.999
):
"""... | 34.580357 | 118 | 0.587916 | import numpy as np
class OptimizerADAM:
def __init__(
self,
learning_rate=0.001,
decay=0.,
epsilon=1e-7,
beta_1=0.9,
beta_2=0.999
):
self.learning_rate = learning_rate
self.current_learning_rate = learning_rate
se... | true | true |
08eff1e57a403faf4a2dd8763ccb74611ebb3a8a | 2,164 | py | Python | roman_numerals_webservice/roman_numerals/arabic_to_roman.py | DerThorsten/roman_numerals_webservice | 8d29c5141951cead9a15cd62131220bd402eb851 | [
"MIT"
] | null | null | null | roman_numerals_webservice/roman_numerals/arabic_to_roman.py | DerThorsten/roman_numerals_webservice | 8d29c5141951cead9a15cd62131220bd402eb851 | [
"MIT"
] | 1 | 2019-07-23T20:54:02.000Z | 2019-07-23T20:56:43.000Z | roman_numerals_webservice/roman_numerals/arabic_to_roman.py | DerThorsten/roman_numerals_webservice | 8d29c5141951cead9a15cd62131220bd402eb851 | [
"MIT"
] | null | null | null | import numbers
class ArabicToRoman(object):
_int_nums = (
(1000, "M"),
(900, "CM"),
(500, "D"),
(400, "CD"),
(100, "C"),
(90, "XC"),
(50, "L"),
(40, "XL"),
(10, "X"),
(9, "IX"),
(5, "V"),
(4, "IV"),
(1, "I"),
... | 28.853333 | 110 | 0.566081 | import numbers
class ArabicToRoman(object):
_int_nums = (
(1000, "M"),
(900, "CM"),
(500, "D"),
(400, "CD"),
(100, "C"),
(90, "XC"),
(50, "L"),
(40, "XL"),
(10, "X"),
(9, "IX"),
(5, "V"),
(4, "IV"),
(1, "I"),
... | true | true |
08eff2614ea98c115080a07104553fd0c335272b | 1,917 | py | Python | 2022/CVE-2022-0218/poc/pocsploit/CVE-2022-0218.py | hjyuan/reapoc | ef515e56c44c2590ff8601582bf6c08e076e7083 | [
"Apache-2.0"
] | 421 | 2021-12-07T08:46:40.000Z | 2022-03-31T12:42:16.000Z | 2022/CVE-2022-0218/poc/pocsploit/CVE-2022-0218.py | hjyuan/reapoc | ef515e56c44c2590ff8601582bf6c08e076e7083 | [
"Apache-2.0"
] | 5 | 2022-03-27T07:37:32.000Z | 2022-03-31T13:56:11.000Z | 2022/CVE-2022-0218/poc/pocsploit/CVE-2022-0218.py | hjyuan/reapoc | ef515e56c44c2590ff8601582bf6c08e076e7083 | [
"Apache-2.0"
] | 144 | 2021-12-07T11:06:14.000Z | 2022-03-31T07:41:35.000Z | import requests
# Vuln Base Info
def info():
return {
"author": "cckuailong",
"name": '''HTML Email Template Designer < 3.1 - Stored Cross-Site Scripting''',
"description": '''WordPress Email Template Designer WP HTML Mail allows stored cross-site scripting through an unprotected REST-API ... | 29.492308 | 153 | 0.567032 | import requests
def info():
return {
"author": "cckuailong",
"name": '''HTML Email Template Designer < 3.1 - Stored Cross-Site Scripting''',
"description": '''WordPress Email Template Designer WP HTML Mail allows stored cross-site scripting through an unprotected REST-API endpoint.''',
... | true | true |
08eff37ee0398df773bc9a3c9ae676e47907721e | 505 | py | Python | chemreg/resolution/tests/test_views.py | Chemical-Curation/chemcurator | bcd7fab84e407f06502e6873c38820724d4e54e7 | [
"MIT"
] | 1 | 2020-10-05T18:02:24.000Z | 2020-10-05T18:02:24.000Z | chemreg/resolution/tests/test_views.py | Chemical-Curation/chemcurator_django | bcd7fab84e407f06502e6873c38820724d4e54e7 | [
"MIT"
] | 207 | 2020-01-30T19:17:44.000Z | 2021-02-24T19:45:29.000Z | chemreg/resolution/tests/test_views.py | Chemical-Curation/chemcurator_django | bcd7fab84e407f06502e6873c38820724d4e54e7 | [
"MIT"
] | null | null | null | import pytest
from chemreg.jsonapi.views import ModelViewSet
from chemreg.resolution.views import ResolverViewSet
def test_resolution_view():
"""Tests that the Resolver View Set, is a sub class of the Model View Set."""
assert issubclass(ResolverViewSet, ModelViewSet)
@pytest.mark.django_db
def test_resolu... | 29.705882 | 88 | 0.756436 | import pytest
from chemreg.jsonapi.views import ModelViewSet
from chemreg.resolution.views import ResolverViewSet
def test_resolution_view():
assert issubclass(ResolverViewSet, ModelViewSet)
@pytest.mark.django_db
def test_resolution_parameter(client):
resp = client.get("/resolution")
assert resp.statu... | true | true |
08eff381575ada59fe33ff1e6450b775dde2542d | 2,628 | py | Python | backend/ohq/migrations/0002_auto_20200816_1727.py | pennlabs/Office-Hours-Queue | f73ec90223c43595c9a167162d9d74abfb11ca42 | [
"MIT"
] | 8 | 2020-05-08T15:28:51.000Z | 2020-05-28T03:27:03.000Z | backend/ohq/migrations/0002_auto_20200816_1727.py | pennlabs/Office-Hours-Queue | f73ec90223c43595c9a167162d9d74abfb11ca42 | [
"MIT"
] | 161 | 2020-08-05T17:05:56.000Z | 2022-03-27T17:44:51.000Z | backend/ohq/migrations/0002_auto_20200816_1727.py | pennlabs/office-hours-queue | fce98d3a1b83d1459f61e6d9c3347ef619ee384e | [
"MIT"
] | null | null | null | # Generated by Django 3.1 on 2020-08-16 21:27
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("ohq", "0001_initial"),
... | 35.513514 | 90 | 0.560122 |
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("ohq", "0001_initial"),
]
operations = [
migrations.Rena... | true | true |
08eff568a431ff0a8c54184953b81016645576d6 | 939 | py | Python | base/generate_data.py | liuysong/CTR | 0ba753c40e7209ef03e672eab0276be72f60d3ed | [
"MIT"
] | null | null | null | base/generate_data.py | liuysong/CTR | 0ba753c40e7209ef03e672eab0276be72f60d3ed | [
"MIT"
] | null | null | null | base/generate_data.py | liuysong/CTR | 0ba753c40e7209ef03e672eab0276be72f60d3ed | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
import scipy as sc
import utils
import datetime
import collections
import os
import random
import config_path
import preprocess
train_path = config_path.train_path
test_path = config_path.test_path
dnsp_data_dir = config_path.dnsp_data_dir
fe_gen_dir = config_path.fe_gen_dir
mod... | 31.3 | 142 | 0.841321 | import pandas as pd
import numpy as np
import scipy as sc
import utils
import datetime
import collections
import os
import random
import config_path
import preprocess
train_path = config_path.train_path
test_path = config_path.test_path
dnsp_data_dir = config_path.dnsp_data_dir
fe_gen_dir = config_path.fe_gen_dir
mod... | true | true |
08eff5c707047ab2e2ae1bf124282a5f7601f9cf | 7,313 | py | Python | examples/pwr_run/checkpointing/final_eval/k80_only/job27.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | examples/pwr_run/checkpointing/final_eval/k80_only/job27.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | examples/pwr_run/checkpointing/final_eval/k80_only/job27.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | """
#Trains a ResNet on the CIFAR10 dataset.
"""
from __future__ import print_function
import keras
from keras.layers import Dense, Conv2D, BatchNormalization, Activation
from keras.layers import AveragePooling2D, Input, Flatten
from keras.optimizers import Adam
from keras.callbacks import ModelCheckpoint, LearningRa... | 32.074561 | 118 | 0.692192 |
from __future__ import print_function
import keras
from keras.layers import Dense, Conv2D, BatchNormalization, Activation
from keras.layers import AveragePooling2D, Input, Flatten
from keras.optimizers import Adam
from keras.callbacks import ModelCheckpoint, LearningRateScheduler
from keras.callbacks import ReduceLROn... | true | true |
08eff7bf3ae3445caf36bf2f8295721764665228 | 853 | py | Python | actions/get_bgp_config.py | cognifloyd/stackstorm-napalm | 63a1ffe98d4d9f955b89b833f79629297e2585c8 | [
"Apache-2.0"
] | 29 | 2017-03-10T20:27:35.000Z | 2021-06-05T23:53:04.000Z | actions/get_bgp_config.py | floatingstatic/stackstorm-napalm | 979e476404666b513b2790e7e19d386146431068 | [
"Apache-2.0"
] | 56 | 2017-02-10T16:01:51.000Z | 2021-10-22T03:00:04.000Z | actions/get_bgp_config.py | floatingstatic/stackstorm-napalm | 979e476404666b513b2790e7e19d386146431068 | [
"Apache-2.0"
] | 16 | 2016-12-13T21:05:16.000Z | 2021-09-15T07:35:16.000Z | from lib.action import NapalmBaseAction
class NapalmGetBGPConfig(NapalmBaseAction):
"""Get BGP configuration from a network device via NAPALM
"""
def run(self, group, neighbor, **std_kwargs):
with self.get_driver(**std_kwargs) as device:
if not group:
if not neighbor... | 29.413793 | 83 | 0.554513 | from lib.action import NapalmBaseAction
class NapalmGetBGPConfig(NapalmBaseAction):
def run(self, group, neighbor, **std_kwargs):
with self.get_driver(**std_kwargs) as device:
if not group:
if not neighbor:
bgpconf = device.get_bgp_config()
... | true | true |
08eff8abfcee0ad2bb67ca8a6ae98fd4f22bc22a | 8,343 | py | Python | test/test_gen_single.py | proppy/GenSON | 75287c3f2a3e58effd013d3a667484b21fe8a9e5 | [
"MIT"
] | null | null | null | test/test_gen_single.py | proppy/GenSON | 75287c3f2a3e58effd013d3a667484b21fe8a9e5 | [
"MIT"
] | null | null | null | test/test_gen_single.py | proppy/GenSON | 75287c3f2a3e58effd013d3a667484b21fe8a9e5 | [
"MIT"
] | null | null | null | from . import base
class TestBasicTypes(base.SchemaNodeTestCase):
def test_no_object(self):
self.assertResult({})
def test_string(self):
self.add_object("string")
self.assertResult({"type": "string"})
def test_integer(self):
self.add_object(1)
self.assertResult({... | 30.010791 | 74 | 0.466139 | from . import base
class TestBasicTypes(base.SchemaNodeTestCase):
def test_no_object(self):
self.assertResult({})
def test_string(self):
self.add_object("string")
self.assertResult({"type": "string"})
def test_integer(self):
self.add_object(1)
self.assertResult({... | true | true |
08eff8ece4e4d0e02fa78d511235c1c0c89a9983 | 7,373 | py | Python | autochange/filehandling.py | jhave87/automated-changes | e7da591eab78dcd7003c918d2ba36699d1ebce9c | [
"MIT"
] | null | null | null | autochange/filehandling.py | jhave87/automated-changes | e7da591eab78dcd7003c918d2ba36699d1ebce9c | [
"MIT"
] | null | null | null | autochange/filehandling.py | jhave87/automated-changes | e7da591eab78dcd7003c918d2ba36699d1ebce9c | [
"MIT"
] | null | null | null | import os
import sys
import time
import logging
from datetime import datetime
from watchdog.observers.polling import PollingObserver
from watchdog.events import PatternMatchingEventHandler
def logSetup(file_name):
"""
Function for setting up a new log to track the case creation process
and for logging unh... | 34.293023 | 77 | 0.617523 | import os
import sys
import time
import logging
from datetime import datetime
from watchdog.observers.polling import PollingObserver
from watchdog.events import PatternMatchingEventHandler
def logSetup(file_name):
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
f_handler = logg... | true | true |
08eff9441778beeba59585245cbd3ca8d2c9911d | 9,757 | py | Python | examples/web_demo/app.py | ayzk/ft-caffe-public | 888399c2fcf90c227416576a5a265b218c6be5da | [
"BSD-2-Clause"
] | 933 | 2016-08-29T14:29:20.000Z | 2022-03-20T09:03:49.000Z | examples/web_demo/app.py | ayzk/ft-caffe-public | 888399c2fcf90c227416576a5a265b218c6be5da | [
"BSD-2-Clause"
] | 286 | 2016-08-30T01:33:01.000Z | 2021-08-22T08:34:19.000Z | examples/web_demo/app.py | ayzk/ft-caffe-public | 888399c2fcf90c227416576a5a265b218c6be5da | [
"BSD-2-Clause"
] | 611 | 2016-08-30T07:22:04.000Z | 2021-12-18T11:53:08.000Z | #
# All modification made by Intel Corporation: Copyright (c) 2016 Intel Corporation
#
# All contributions by the University of California:
# Copyright (c) 2014, 2015, The Regents of the University of California (Regents)
# All rights reserved.
#
# All other contributions:
# Copyright (c) 2014, 2015, the respective ... | 36.958333 | 105 | 0.648048 | import os
import time
import cPickle
import datetime
import logging
import flask
import werkzeug
import optparse
import tornado.wsgi
import tornado.httpserver
import numpy as np
import pandas as pd
from PIL import Image
import cStringIO as StringIO
import urllib
import exifutil
import caffe
REPO_DIRNAME = os.path.abs... | true | true |
08eff944d18dcb57c6c15b7d303edca3737c20bc | 10,152 | py | Python | factorize_a_city/libs/image_alignment.py | deepneuralmachine/google-research | d2ce2cf0f5c004f8d78bfeddf6e88e88f4840231 | [
"Apache-2.0"
] | 23,901 | 2018-10-04T19:48:53.000Z | 2022-03-31T21:27:42.000Z | factorize_a_city/libs/image_alignment.py | deepneuralmachine/google-research | d2ce2cf0f5c004f8d78bfeddf6e88e88f4840231 | [
"Apache-2.0"
] | 891 | 2018-11-10T06:16:13.000Z | 2022-03-31T10:42:34.000Z | factorize_a_city/libs/image_alignment.py | deepneuralmachine/google-research | d2ce2cf0f5c004f8d78bfeddf6e88e88f4840231 | [
"Apache-2.0"
] | 6,047 | 2018-10-12T06:31:02.000Z | 2022-03-31T13:59:28.000Z | # coding=utf-8
# Copyright 2021 The Google Research 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 applicab... | 40.285714 | 82 | 0.682821 |
import numpy as np
import tensorflow as tf
import tensorflow.contrib.resampler as contrib_resampler
from factorize_a_city.libs import bspline
def interpolate_2d(knots, positions, degree, cyclical):
batch_size, knots_height, knots_width, knots_ch = knots.shape.as_list()
y_weights, y_ind = bspline.knot_weights(
... | true | true |
08eff94fdceb2ccbacc041570247b0ce972420ea | 5,987 | py | Python | reagent/reporting/seq2reward_reporter.py | kellielu/ReAgent | c538992672220453cdc95044def25c4e0691a8b0 | [
"BSD-3-Clause"
] | null | null | null | reagent/reporting/seq2reward_reporter.py | kellielu/ReAgent | c538992672220453cdc95044def25c4e0691a8b0 | [
"BSD-3-Clause"
] | null | null | null | reagent/reporting/seq2reward_reporter.py | kellielu/ReAgent | c538992672220453cdc95044def25c4e0691a8b0 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
import itertools
import logging
from typing import List
import torch
from reagent.core import aggregators as agg
from reagent.core.observers import IntervalAggregatingObserver
from reagent.reporting.reporter_base import ReporterBase
from reagent.workflow.training_reports import Seq2RewardTraini... | 39.130719 | 85 | 0.451645 |
import itertools
import logging
from typing import List
import torch
from reagent.core import aggregators as agg
from reagent.core.observers import IntervalAggregatingObserver
from reagent.reporting.reporter_base import ReporterBase
from reagent.workflow.training_reports import Seq2RewardTrainingReport
logger = log... | true | true |
08eff95f84c778e92813abddc581de9fa73e15e2 | 7,943 | py | Python | eventkit_cloud/utils/auth_requests.py | venicegeo/eventkit-cloud | 3a9a4fbfea54d48387f3f3b2ab6e71946af9ffb2 | [
"BSD-3-Clause"
] | 1 | 2018-03-30T21:01:15.000Z | 2018-03-30T21:01:15.000Z | eventkit_cloud/utils/auth_requests.py | venicegeo/eventkit-cloud | 3a9a4fbfea54d48387f3f3b2ab6e71946af9ffb2 | [
"BSD-3-Clause"
] | 46 | 2017-06-27T03:12:57.000Z | 2018-12-28T19:48:35.000Z | eventkit_cloud/utils/auth_requests.py | venicegeo/eventkit-cloud | 3a9a4fbfea54d48387f3f3b2ab6e71946af9ffb2 | [
"BSD-3-Clause"
] | 7 | 2017-07-28T18:16:34.000Z | 2019-01-18T04:41:55.000Z | # -*- coding: utf-8 -*-
import http.client
import logging
import os
import re
import urllib.error
import urllib.parse
from functools import wraps
from http.cookiejar import CookieJar
from tempfile import NamedTemporaryFile
from typing import Any
from django.conf import settings
from mapproxy.client import http as mapp... | 38.004785 | 120 | 0.655546 | import http.client
import logging
import os
import re
import urllib.error
import urllib.parse
from functools import wraps
from http.cookiejar import CookieJar
from tempfile import NamedTemporaryFile
from typing import Any
from django.conf import settings
from mapproxy.client import http as mapproxy_http
from requests_... | true | true |
08eff9831e8072898b79ed0c9749e6441d5de26e | 9,643 | py | Python | hpack/table.py | steamraven/hpack | c76d07a6b07a3473bde21b972353be3863a9b68f | [
"MIT"
] | 1 | 2018-01-26T06:11:54.000Z | 2018-01-26T06:11:54.000Z | hpack/table.py | steamraven/hpack | c76d07a6b07a3473bde21b972353be3863a9b68f | [
"MIT"
] | null | null | null | hpack/table.py | steamraven/hpack | c76d07a6b07a3473bde21b972353be3863a9b68f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# flake8: noqa
from collections import deque
import logging
from .exceptions import InvalidTableIndex
log = logging.getLogger(__name__)
def table_entry_size(name, value):
"""
Calculates the size of a single entry
This size is mostly irrelevant to us and defined
specifically ... | 40.860169 | 86 | 0.449445 | from collections import deque
import logging
from .exceptions import InvalidTableIndex
log = logging.getLogger(__name__)
def table_entry_size(name, value):
return 32 + len(name) + len(value)
class HeaderTable(object):
DEFAULT_SIZE = 4096
STATIC_TABLE = (
(b':authority' ... | true | true |
08eff99e56b8628dcabd5d11a06b513ff5033aa9 | 6,275 | py | Python | rf2db/db/RF2ModuleVersionsFile.py | cts2/rf2db | 985cd7ad84c8907306a0d7d309d4a1c0fb422ba4 | [
"BSD-3-Clause"
] | null | null | null | rf2db/db/RF2ModuleVersionsFile.py | cts2/rf2db | 985cd7ad84c8907306a0d7d309d4a1c0fb422ba4 | [
"BSD-3-Clause"
] | null | null | null | rf2db/db/RF2ModuleVersionsFile.py | cts2/rf2db | 985cd7ad84c8907306a0d7d309d4a1c0fb422ba4 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2013, Mayo Clinic
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# ... | 46.481481 | 125 | 0.651633 |
from rf2db.db.RF2FileCommon import RF2FileWrapper
from rf2db.db.RF2ConceptFile import ConceptDB
from rf2db.db.RF2DescriptionFile import DescriptionDB
from rf2db.db.RF2RelationshipFile import RelationshipDB
from rf2db.db.RF2StatedRelationshipFile import StatedRelationshipDB
from rf2db.db.RF2ChangeSetFile import Change... | true | true |
08effaf1ee7d130956a6ced88de5bfc255b1fe63 | 5,954 | py | Python | test/functional/rpc_users.py | decenomy/BECN | de00ed19a7a6bf0a56c196335fe6e79318fc78c3 | [
"MIT"
] | 15 | 2018-11-15T19:31:40.000Z | 2020-06-03T15:28:49.000Z | test/functional/rpc_users.py | decenomy/BECN | de00ed19a7a6bf0a56c196335fe6e79318fc78c3 | [
"MIT"
] | 1 | 2019-11-14T20:39:26.000Z | 2019-11-15T02:16:51.000Z | test/functional/rpc_users.py | decenomy/BECN | de00ed19a7a6bf0a56c196335fe6e79318fc78c3 | [
"MIT"
] | 18 | 2018-11-19T19:37:51.000Z | 2021-07-16T17:21:09.000Z | #!/usr/bin/env python3
# Copyright (c) 2015-2017 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 multiple RPC users."""
from test_framework.test_framework import PivxTestFramework
from test_fram... | 38.662338 | 129 | 0.613537 |
from test_framework.test_framework import PivxTestFramework
from test_framework.util import str_to_b64str, assert_equal
import os
import http.client
import urllib.parse
class HTTPBasicsTest (PivxTestFramework):
def set_test_params(self):
self.num_nodes = 2
def setup_chain(self):
super().setu... | true | true |
08effb767f24abc593bae884e6f1091de1d3e3df | 11,682 | py | Python | psychopy/piloting/trust_game_task_textNH.py | victoriaakelly/srndna-master | 2b9a89e0ac78a6f87620cd528dd8f788e3fc3901 | [
"MIT"
] | 3 | 2019-08-13T19:49:40.000Z | 2020-10-08T18:35:17.000Z | psychopy/piloting/trust_game_task_textNH.py | victoriaakelly/srndna-master | 2b9a89e0ac78a6f87620cd528dd8f788e3fc3901 | [
"MIT"
] | null | null | null | psychopy/piloting/trust_game_task_textNH.py | victoriaakelly/srndna-master | 2b9a89e0ac78a6f87620cd528dd8f788e3fc3901 | [
"MIT"
] | 9 | 2018-07-27T19:05:06.000Z | 2021-04-26T08:50:25.000Z | #### trust game task ####
# ebeard
# 5/30/18
# edited by Dominic Fareri, 6/2018
### specs ###
# add task description here
### timing ###
# add timing info here
#import modules
from psychopy import visual, core, event, gui, data, sound, logging
import os
import sys
import csv
import datetime
import random
#maind... | 32.54039 | 205 | 0.59168 |
from psychopy import visual, core, event, gui, data, sound, logging
import os
import sys
import csv
import datetime
import random
DEBUG = False
frame_rate=1
decision_dur=3
instruct_dur=3
outcome_dur=1
responseKeys=('2','3','z')
if DEBUG:
subj_id='test_2' friend_id='pal'
stranger_id='stranger'
... | false | true |
08effc509a0815b484d6a6360ee1109fc2d50efb | 1,052 | py | Python | acmicpc/2098/2098.py | love-adela/algorithm | 4ccd02173c96f8369962f1fd4e5166a221690fa2 | [
"MIT"
] | 3 | 2019-03-09T05:19:23.000Z | 2019-04-06T09:26:36.000Z | acmicpc/2098/2098.py | love-adela/algorithm | 4ccd02173c96f8369962f1fd4e5166a221690fa2 | [
"MIT"
] | 1 | 2020-02-23T10:38:04.000Z | 2020-02-23T10:38:04.000Z | acmicpc/2098/2098.py | love-adela/algorithm | 4ccd02173c96f8369962f1fd4e5166a221690fa2 | [
"MIT"
] | 1 | 2019-05-22T13:47:53.000Z | 2019-05-22T13:47:53.000Z | import sys
read = lambda: sys.stdin.readline()
N = int(read())
W = []
for i in range(N):
edge = [int(x) for x in read().split()]
W.append(edge)
visited_list = [[] for j in range(N)]
memo = [{} for i in range(N)]
for i in range(N):
if W[i][0] > 0:
visited_list[i].append(0)
memo[i][0] =... | 27.684211 | 94 | 0.573194 | import sys
read = lambda: sys.stdin.readline()
N = int(read())
W = []
for i in range(N):
edge = [int(x) for x in read().split()]
W.append(edge)
visited_list = [[] for j in range(N)]
memo = [{} for i in range(N)]
for i in range(N):
if W[i][0] > 0:
visited_list[i].append(0)
memo[i][0] =... | true | true |
08effc5bd6bdcbd2af9d5a78cad7dcc27f044bab | 459 | py | Python | s.py | Soosai007/Python-projects- | 3cd61e7019a77ccf46a7805827bef2ac6371af3a | [
"MIT"
] | null | null | null | s.py | Soosai007/Python-projects- | 3cd61e7019a77ccf46a7805827bef2ac6371af3a | [
"MIT"
] | null | null | null | s.py | Soosai007/Python-projects- | 3cd61e7019a77ccf46a7805827bef2ac6371af3a | [
"MIT"
] | null | null | null | # importing required modules
import PyPDF2
# creating a pdf file object
pdfFileObj = open('sample.pdf', 'rb')
# creating a pdf reader object
pdfReader = PyPDF2.PdfFileReader(pdfFileObj)
# printing number of pages in pdf file
print(pdfReader.numPages)
# creating a page object
pageObj = pdfR... | 21.857143 | 46 | 0.703704 | import PyPDF2
pdfFileObj = open('sample.pdf', 'rb')
pdfReader = PyPDF2.PdfFileReader(pdfFileObj)
print(pdfReader.numPages)
pageObj = pdfReader.getPage(0)
print(pageObj.extractText())
pdfFileObj.close()
| true | true |
08effce72b5b36b694387823b505d4023ccdf823 | 11,556 | py | Python | neurosynchro/cli.py | pkgw/neurosynchro | f21d198e01146988944728231417ff601b706379 | [
"MIT"
] | null | null | null | neurosynchro/cli.py | pkgw/neurosynchro | f21d198e01146988944728231417ff601b706379 | [
"MIT"
] | 2 | 2020-09-26T16:09:24.000Z | 2021-05-21T16:34:51.000Z | neurosynchro/cli.py | pkgw/neurosynchro | f21d198e01146988944728231417ff601b706379 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
# -*- mode: python; coding: utf-8 -*-
# Copyright 2017-2018 Peter Williams and collaborators.
# Licensed under the MIT License.
"""Command-line access to neurosynchro functionality.
"""
from __future__ import absolute_import, division, print_function
import argparse, sys
import numpy as np
fro... | 28.463054 | 98 | 0.600987 |
from __future__ import absolute_import, division, print_function
import argparse, sys
import numpy as np
from pwkit.cli import die
from pwkit.io import Path
import pytoml
from . import basic_load
def _hack_pytoml():
from pytoml import writer
orig_format_value = writer._format_value
if not getattr(ori... | true | true |
08effdfd2e6fe95d3099e010b2ec8962c747e41a | 3,242 | py | Python | graviton2/elasticsearch_graviton/es.py | muraria/graviton2-workshop | 74354303059d7a13ab1b91a26589abb04ea3e512 | [
"MIT-0"
] | 7 | 2021-04-12T20:32:15.000Z | 2021-07-11T02:12:52.000Z | graviton2/elasticsearch_graviton/es.py | muraria/graviton2-workshop | 74354303059d7a13ab1b91a26589abb04ea3e512 | [
"MIT-0"
] | 2 | 2021-07-12T16:02:41.000Z | 2021-07-30T17:08:08.000Z | graviton2/elasticsearch_graviton/es.py | muraria/graviton2-workshop | 74354303059d7a13ab1b91a26589abb04ea3e512 | [
"MIT-0"
] | 16 | 2021-04-15T06:19:41.000Z | 2022-03-07T00:50:49.000Z | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: MIT-0
from aws_cdk import core
import aws_cdk.aws_ec2 as ec2
import aws_cdk.aws_elasticsearch as es
import aws_cdk.aws_events as events
import aws_cdk.aws_events_targets as events_targets
import aws_cdk.aws_iam as iam
import ... | 42.657895 | 103 | 0.531154 |
from aws_cdk import core
import aws_cdk.aws_ec2 as ec2
import aws_cdk.aws_elasticsearch as es
import aws_cdk.aws_events as events
import aws_cdk.aws_events_targets as events_targets
import aws_cdk.aws_iam as iam
import aws_cdk.aws_lambda as _lambda
from aws_cdk.aws_lambda_python import PythonFunction
import os
c9_ip ... | true | true |
08effe43781c955265ca38a834e57d0c44153346 | 1,197 | py | Python | CMSIS/DSP/SDFTools/sdf/__init__.py | DavidLesnjak/CMSIS_5 | e0848410d137758a3356a5ee94ca4501cea708a8 | [
"Apache-2.0"
] | 2,293 | 2016-02-25T06:47:33.000Z | 2022-03-29T16:44:02.000Z | CMSIS/DSP/SDFTools/sdf/__init__.py | DavidLesnjak/CMSIS_5 | e0848410d137758a3356a5ee94ca4501cea708a8 | [
"Apache-2.0"
] | 1,125 | 2016-02-27T09:56:01.000Z | 2022-03-31T13:57:05.000Z | CMSIS/DSP/SDFTools/sdf/__init__.py | DavidLesnjak/CMSIS_5 | e0848410d137758a3356a5ee94ca4501cea708a8 | [
"Apache-2.0"
] | 1,160 | 2016-02-27T09:06:10.000Z | 2022-03-31T19:06:24.000Z | ###########################################
# Project: CMSIS DSP Library
# Title: __init__.py
# Description: SDF module
#
# $Date: 30 August 2021
# $Revision: V1.10.0
#
# Target Processor: Cortex-M and Cortex-A cores
# -------------------------------------------------------------------- */
#
#... | 34.2 | 77 | 0.637427 |
from sdf.schedule.node import *
from sdf.schedule.types import *
from sdf.schedule.description import *
from sdf.schedule.config import *
from sdf.schedule.standard import *
| true | true |
08efff44527955895a3ab2d598051b16973aaee3 | 56,053 | py | Python | tensorflow/python/distribute/coordinator/cluster_coordinator.py | ibeauregard/tensorflow | 898ae24a05ae738a816bca5f20226f8323dc1b21 | [
"Apache-2.0"
] | 2 | 2020-04-02T11:52:00.000Z | 2020-05-29T09:02:00.000Z | tensorflow/python/distribute/coordinator/cluster_coordinator.py | saryazdi/tensorflow | 8e2be96fdc388049efe4bdbfa7a92e139ed0f4cb | [
"Apache-2.0"
] | 1 | 2020-05-16T01:56:36.000Z | 2020-05-16T01:56:36.000Z | tensorflow/python/distribute/coordinator/cluster_coordinator.py | saryazdi/tensorflow | 8e2be96fdc388049efe4bdbfa7a92e139ed0f4cb | [
"Apache-2.0"
] | 1 | 2021-12-06T17:11:35.000Z | 2021-12-06T17:11:35.000Z | # Lint as: python3
# Copyright 2020 The TensorFlow 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 requ... | 40.618116 | 115 | 0.72187 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import contextlib
import enum
import functools
import os
import re
import sys
import threading
import time
import weakref
from six.moves import queue
from tensorflow.python.data.ops import iterator_ops
from t... | true | true |
08efffbe55f4f0a4d8004f65294b5b750421df0b | 54,026 | py | Python | rasa/server.py | andreoid/rasa | f104371249ac64476a50196d174bb2e637b6a2a5 | [
"Apache-2.0"
] | null | null | null | rasa/server.py | andreoid/rasa | f104371249ac64476a50196d174bb2e637b6a2a5 | [
"Apache-2.0"
] | null | null | null | rasa/server.py | andreoid/rasa | f104371249ac64476a50196d174bb2e637b6a2a5 | [
"Apache-2.0"
] | null | null | null | import asyncio
import concurrent.futures
import logging
import multiprocessing
import os
import tempfile
import traceback
from collections import defaultdict
from functools import reduce, wraps
from inspect import isawaitable
from pathlib import Path
from http import HTTPStatus
from typing import (
Any,
Callabl... | 36.234742 | 89 | 0.621812 | import asyncio
import concurrent.futures
import logging
import multiprocessing
import os
import tempfile
import traceback
from collections import defaultdict
from functools import reduce, wraps
from inspect import isawaitable
from pathlib import Path
from http import HTTPStatus
from typing import (
Any,
Callabl... | true | true |
08efffdf143cc04eef4598f767439969b09b0a1e | 2,132 | py | Python | rlkit/data_management/replay_buffer.py | hammer-wang/FOCAL-ICLR | 4d19149f86acc1d6b987c93cdd3a9d957535c5e3 | [
"MIT"
] | 24 | 2021-03-24T07:14:52.000Z | 2022-03-17T08:15:44.000Z | rlkit/data_management/replay_buffer.py | hammer-wang/FOCAL-ICLR | 4d19149f86acc1d6b987c93cdd3a9d957535c5e3 | [
"MIT"
] | 4 | 2021-06-18T16:38:38.000Z | 2022-03-18T11:04:45.000Z | rlkit/data_management/replay_buffer.py | hammer-wang/FOCAL-ICLR | 4d19149f86acc1d6b987c93cdd3a9d957535c5e3 | [
"MIT"
] | 6 | 2021-04-12T18:49:47.000Z | 2021-09-07T05:33:22.000Z | import abc
class ReplayBuffer(object, metaclass=abc.ABCMeta):
"""
A class used to save and replay data.
"""
@abc.abstractmethod
def add_sample(self, observation, action, reward, next_observation,
terminal, **kwargs):
"""
Add a transition tuple.
"""
... | 26 | 79 | 0.507974 | import abc
class ReplayBuffer(object, metaclass=abc.ABCMeta):
@abc.abstractmethod
def add_sample(self, observation, action, reward, next_observation,
terminal, **kwargs):
pass
@abc.abstractmethod
def terminate_episode(self):
pass
@abc.abstractmethod
def nu... | true | true |
08effff5575c808c330dc927dad48aaa08207241 | 22,230 | py | Python | tests/khalendar_test.py | pianoslum/khal | 2ef71a9c5a814dd73c46d20e30c5221efea701b0 | [
"MIT"
] | null | null | null | tests/khalendar_test.py | pianoslum/khal | 2ef71a9c5a814dd73c46d20e30c5221efea701b0 | [
"MIT"
] | 11 | 2020-04-11T11:22:03.000Z | 2020-04-16T18:16:47.000Z | tests/khalendar_test.py | pianoslum/khal | 2ef71a9c5a814dd73c46d20e30c5221efea701b0 | [
"MIT"
] | 1 | 2019-10-10T05:16:49.000Z | 2019-10-10T05:16:49.000Z | import datetime as dt
import logging
import os
from textwrap import dedent
from time import sleep
import khal.khalendar.exceptions
import khal.utils
import pytest
from freezegun import freeze_time
from khal import icalendar as icalendar_helpers
from khal.khalendar import CalendarCollection
from khal.khalendar.backend ... | 38.065068 | 100 | 0.639631 | import datetime as dt
import logging
import os
from textwrap import dedent
from time import sleep
import khal.khalendar.exceptions
import khal.utils
import pytest
from freezegun import freeze_time
from khal import icalendar as icalendar_helpers
from khal.khalendar import CalendarCollection
from khal.khalendar.backend ... | true | true |
08f00026b0a8d4a6cccad1a88563ce7a5b83f749 | 1,522 | py | Python | src/config.py | DQiaole/ZITS | 5f7a060167790789d5e29a3d14d3c2ef8a34e765 | [
"Apache-2.0"
] | 40 | 2022-03-02T06:12:43.000Z | 2022-03-30T02:17:02.000Z | src/config.py | DQiaole/ZITS | 5f7a060167790789d5e29a3d14d3c2ef8a34e765 | [
"Apache-2.0"
] | 6 | 2022-03-06T03:53:14.000Z | 2022-03-31T06:36:34.000Z | src/config.py | DQiaole/ZITS | 5f7a060167790789d5e29a3d14d3c2ef8a34e765 | [
"Apache-2.0"
] | 5 | 2022-03-04T06:39:44.000Z | 2022-03-28T04:58:32.000Z | import os
import yaml
class Config(dict):
def __init__(self, config_path):
with open(config_path, 'r') as f:
self._yaml = f.read()
self._dict = yaml.load(self._yaml, Loader=yaml.FullLoader)
self._dict['PATH'] = os.path.dirname(config_path)
def __getattr__(self, na... | 35.395349 | 107 | 0.557819 | import os
import yaml
class Config(dict):
def __init__(self, config_path):
with open(config_path, 'r') as f:
self._yaml = f.read()
self._dict = yaml.load(self._yaml, Loader=yaml.FullLoader)
self._dict['PATH'] = os.path.dirname(config_path)
def __getattr__(self, na... | true | true |
08f00246056a0e7bda132031b2271affb71eeac8 | 24,180 | py | Python | dnn_app_utils_v2.py | Ulysses0817/Autoencoder | b7a088d884cbbeca44669027130a0c458ee7be75 | [
"Apache-2.0"
] | null | null | null | dnn_app_utils_v2.py | Ulysses0817/Autoencoder | b7a088d884cbbeca44669027130a0c458ee7be75 | [
"Apache-2.0"
] | null | null | null | dnn_app_utils_v2.py | Ulysses0817/Autoencoder | b7a088d884cbbeca44669027130a0c458ee7be75 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import h5py
import math
import os
from forward import *
#os.makedirs("F:\\ProgramData\\NVIDIA Corporation\\CUDA Samples\\v9.0")
# def sigmoid(Z):
# """
# Implements the sigmoid activation in numpy
# Arguments:
# Z -- numpy array of any shape
# Returns:
# A --... | 35.611193 | 152 | 0.65 | import numpy as np
import matplotlib.pyplot as plt
import h5py
import math
import os
from forward import *
# Implements the sigmoid activation in numpy
# Arguments:
# Z -- numpy array of any shape
# Returns:
# A -- output of sigmoid(z), same shape as Z
# cache -- returns Z as well, useful during backpropagat... | true | true |
08f0038447af2455b9c784864cc200c332ed93c1 | 449 | py | Python | lib_photo_scanner/lib/log.py | Techainer/lib_photo_scanner | 58f7efa5e5b9630bc063d614bfbfde904bfa4f00 | [
"MIT"
] | null | null | null | lib_photo_scanner/lib/log.py | Techainer/lib_photo_scanner | 58f7efa5e5b9630bc063d614bfbfde904bfa4f00 | [
"MIT"
] | null | null | null | lib_photo_scanner/lib/log.py | Techainer/lib_photo_scanner | 58f7efa5e5b9630bc063d614bfbfde904bfa4f00 | [
"MIT"
] | null | null | null | import logging
from logging.handlers import RotatingFileHandler
rfh = RotatingFileHandler(
filename='./lib_photo_scanner.log',
mode='a',
maxBytes=100*1024,
backupCount=2,
encoding=None,
delay=0
)
logging.basicConfig(
level=logging.DEBUG,
format="%(asctime)s %(levelname)s %(funcName)s(... | 20.409091 | 76 | 0.64588 | import logging
from logging.handlers import RotatingFileHandler
rfh = RotatingFileHandler(
filename='./lib_photo_scanner.log',
mode='a',
maxBytes=100*1024,
backupCount=2,
encoding=None,
delay=0
)
logging.basicConfig(
level=logging.DEBUG,
format="%(asctime)s %(levelname)s %(funcName)s(... | true | true |
08f003c0cf332bf21ebeaef2b7be240a311a77a1 | 15,696 | py | Python | Github-Arduino/libraries/db9052_RTC/python/rtc_interface.py | famley-richards/Documents-KTibow | b5d2be03ea2f6687cd9d854d9f43ef839a37e275 | [
"MIT"
] | 4 | 2017-12-28T08:44:08.000Z | 2021-06-10T13:08:52.000Z | Github-Arduino/libraries/db9052_RTC/python/rtc_interface.py | famley-richards/Documents-KTibow | b5d2be03ea2f6687cd9d854d9f43ef839a37e275 | [
"MIT"
] | 3 | 2018-07-26T11:59:21.000Z | 2019-07-05T20:57:25.000Z | Github-Arduino/libraries/db9052_RTC/python/rtc_interface.py | famley-richards/Documents-KTibow | b5d2be03ea2f6687cd9d854d9f43ef839a37e275 | [
"MIT"
] | 10 | 2016-04-22T18:35:32.000Z | 2019-06-08T04:19:51.000Z | # -*- coding: utf-8 -*-
"""An interface to the Beaglebone Black-based Real-Time Controller
Should work with both Python 2 and Python 3
Requires: libusb1 python modules and the appropriate libusb1 library
(Windows or Linux)
@author: David A.W. Barton (david.barton@bristol.ac.uk)
Copyright (c) 2014, David A.W. Barton... | 39.24 | 119 | 0.603784 |
import usb1 import zlib
import ctypes
import struct
from array import array
import threading
from warnings import warn
from time import sleep
MAX_PACKET_SIZE = 64
CMD_GET_PAR_NAMES = 10
CMD_GET_PAR_SIZES = 11
CMD_GET_PAR_TYPES = 12
CMD_GET_PAR_VALUE = 20
CMD_SET_PAR_VALUE = 25
CMD_GET_STREAM = 30
CMD_SOFT_RESET... | true | true |
08f00412a489d40031c3921dc8a80ef9651dad14 | 279 | py | Python | timedelay.py | skydivingdan/Scoreboard | 13ce61e02198eee61cc96babdd8f631a4c757efb | [
"MIT"
] | null | null | null | timedelay.py | skydivingdan/Scoreboard | 13ce61e02198eee61cc96babdd8f631a4c757efb | [
"MIT"
] | null | null | null | timedelay.py | skydivingdan/Scoreboard | 13ce61e02198eee61cc96babdd8f631a4c757efb | [
"MIT"
] | null | null | null | from time import sleep
from datetime import time, datetime
import sys
hour = int(sys.argv[1])
min = int(sys.argv[2])
delayTime = time(hour, min)
while datetime.today().time() < delayTime:
print "\r not yet",
sys.stdout.flush()
sleep(10)
print "I have completed my time"
| 18.6 | 42 | 0.702509 | from time import sleep
from datetime import time, datetime
import sys
hour = int(sys.argv[1])
min = int(sys.argv[2])
delayTime = time(hour, min)
while datetime.today().time() < delayTime:
print "\r not yet",
sys.stdout.flush()
sleep(10)
print "I have completed my time"
| false | true |
08f00526dad3a641f1a100a18381f82c5823e858 | 9,026 | py | Python | tests/python_client/scale/test_index_node_scale.py | drow931/milvus | d6bb86dd46a238efaa42c46f9770aec19cfbcc5b | [
"Apache-2.0"
] | null | null | null | tests/python_client/scale/test_index_node_scale.py | drow931/milvus | d6bb86dd46a238efaa42c46f9770aec19cfbcc5b | [
"Apache-2.0"
] | null | null | null | tests/python_client/scale/test_index_node_scale.py | drow931/milvus | d6bb86dd46a238efaa42c46f9770aec19cfbcc5b | [
"Apache-2.0"
] | null | null | null | import datetime
import pytest
from pymilvus import connections, MilvusException
from base.collection_wrapper import ApiCollectionWrapper
from common.common_type import CaseLabel
from customize.milvus_operator import MilvusOperator
from scale import constants
from common import common_func as cf
from common import com... | 43.394231 | 115 | 0.635719 | import datetime
import pytest
from pymilvus import connections, MilvusException
from base.collection_wrapper import ApiCollectionWrapper
from common.common_type import CaseLabel
from customize.milvus_operator import MilvusOperator
from scale import constants
from common import common_func as cf
from common import com... | true | true |
08f0052f8e559b893f6067608b15e102c5c890de | 7,197 | py | Python | aiokubernetes/models/v1_volume_mount.py | tantioch/aiokubernetes | 2f332498598ece14d22f8e59ecb02665db6db68d | [
"Apache-2.0"
] | 24 | 2018-07-07T15:12:19.000Z | 2021-09-01T07:33:11.000Z | aiokubernetes/models/v1_volume_mount.py | revoteon/aiokubernetes | 730eae03e4779563740f07ad3ecef180b511ac18 | [
"Apache-2.0"
] | 5 | 2018-07-11T00:09:17.000Z | 2018-10-22T16:41:54.000Z | aiokubernetes/models/v1_volume_mount.py | revoteon/aiokubernetes | 730eae03e4779563740f07ad3ecef180b511ac18 | [
"Apache-2.0"
] | 3 | 2018-07-10T10:16:57.000Z | 2018-10-20T19:32:05.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: v1.10.6
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
class V... | 31.565789 | 211 | 0.603585 |
import pprint
import re
class V1VolumeMount(object):
swagger_types = {
'mount_path': 'str',
'mount_propagation': 'str',
'name': 'str',
'read_only': 'bool',
'sub_path': 'str'
}
attribute_map = {
'mount_path': 'mountPath',
'mount_propagation': '... | true | true |
08f00688ea7d822a4f86cbced0a68f70c2f7f446 | 1,039 | py | Python | build/pkgs/numpy/lapack_conf.py | fredstro/sage | c936d2cda81ec7ec3552a3bdb29c994b40d1bb24 | [
"BSL-1.0"
] | 2 | 2018-06-30T01:37:35.000Z | 2018-06-30T01:37:39.000Z | build/pkgs/numpy/lapack_conf.py | boothby/sage | 1b1e6f608d1ef8ee664bb19e991efbbc68cbd51f | [
"BSL-1.0"
] | null | null | null | build/pkgs/numpy/lapack_conf.py | boothby/sage | 1b1e6f608d1ef8ee664bb19e991efbbc68cbd51f | [
"BSL-1.0"
] | null | null | null | #!/usr/bin/env python
import pkgconfig, os
conf_file=open('site.cfg', 'w')
conf_file.write('[ALL]\n')
conf_file.write('library_dirs = '+ os.environ['SAGE_LOCAL']+ '/lib\n')
conf_file.write('include_dirs = '+ os.environ['SAGE_LOCAL']+ '/include\n')
pc_blas = pkgconfig.parse('cblas blas')
pc_lapack = pkgconfig.pars... | 34.633333 | 83 | 0.631376 |
import pkgconfig, os
conf_file=open('site.cfg', 'w')
conf_file.write('[ALL]\n')
conf_file.write('library_dirs = '+ os.environ['SAGE_LOCAL']+ '/lib\n')
conf_file.write('include_dirs = '+ os.environ['SAGE_LOCAL']+ '/include\n')
pc_blas = pkgconfig.parse('cblas blas')
pc_lapack = pkgconfig.parse('lapack')
if not (o... | true | true |
08f00aac08942b6a1266c568b9c53e14fcdcca98 | 8,445 | py | Python | studio/tests/remote_worker_test.py | NunoEdgarGFlowHub/studio | 42b221892a81535842ff25cbbcc434d6422a19e5 | [
"Apache-2.0"
] | null | null | null | studio/tests/remote_worker_test.py | NunoEdgarGFlowHub/studio | 42b221892a81535842ff25cbbcc434d6422a19e5 | [
"Apache-2.0"
] | null | null | null | studio/tests/remote_worker_test.py | NunoEdgarGFlowHub/studio | 42b221892a81535842ff25cbbcc434d6422a19e5 | [
"Apache-2.0"
] | null | null | null | import unittest
import os
import tempfile
import uuid
import subprocess
from studio.pubsub_queue import PubsubQueue
from studio import logs
from local_worker_test import stubtest_worker
from timeout_decorator import timeout
@unittest.skip('testing requires docker')
class RemoteWorkerTest(unittest.TestCase):
_mu... | 32.606178 | 79 | 0.559621 | import unittest
import os
import tempfile
import uuid
import subprocess
from studio.pubsub_queue import PubsubQueue
from studio import logs
from local_worker_test import stubtest_worker
from timeout_decorator import timeout
@unittest.skip('testing requires docker')
class RemoteWorkerTest(unittest.TestCase):
_mu... | true | true |
08f00ace7fa02d605161b12962756ffe87641601 | 389 | py | Python | src/tunews/wsgi.py | thimmy687/tunews | 422a9b14cc0be28139e29a2bdda56840a1c8e1e7 | [
"MIT"
] | 3 | 2021-05-12T21:47:09.000Z | 2021-10-30T12:58:58.000Z | src/tunews/wsgi.py | thimmy687/tunews | 422a9b14cc0be28139e29a2bdda56840a1c8e1e7 | [
"MIT"
] | 8 | 2020-04-06T11:57:24.000Z | 2020-06-04T08:44:23.000Z | src/tunews/wsgi.py | thimmy687/tunews | 422a9b14cc0be28139e29a2bdda56840a1c8e1e7 | [
"MIT"
] | 1 | 2020-04-15T17:56:35.000Z | 2020-04-15T17:56:35.000Z | """
WSGI config for tunews project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTIN... | 22.882353 | 78 | 0.784062 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tunews.settings')
application = get_wsgi_application()
| true | true |
08f00b08eba9ebc7be83b798f9dfa1f22b541c09 | 418 | py | Python | overhave/factory/components/__init__.py | TinkoffCreditSystems/overhave | b0ab705ef5c5c5a65fa0b14b173b64fd7310e187 | [
"Apache-2.0"
] | 33 | 2021-02-01T15:49:37.000Z | 2021-12-20T00:44:43.000Z | overhave/factory/components/__init__.py | TinkoffCreditSystems/overhave | b0ab705ef5c5c5a65fa0b14b173b64fd7310e187 | [
"Apache-2.0"
] | 46 | 2021-02-03T12:56:52.000Z | 2021-12-19T18:50:27.000Z | overhave/factory/components/__init__.py | TinkoffCreditSystems/overhave | b0ab705ef5c5c5a65fa0b14b173b64fd7310e187 | [
"Apache-2.0"
] | 1 | 2021-12-07T09:02:44.000Z | 2021-12-07T09:02:44.000Z | # flake8: noqa
from .abstract_consumer import ITaskConsumerFactory
from .admin_factory import AdminFactory, IAdminFactory
from .emulation_factory import EmulationFactory, IEmulationFactory
from .publication_factory import IPublicationFactory, PublicationFactory
from .synchronizer_factory import ISynchronizerFactory, Sy... | 52.25 | 79 | 0.892344 | from .abstract_consumer import ITaskConsumerFactory
from .admin_factory import AdminFactory, IAdminFactory
from .emulation_factory import EmulationFactory, IEmulationFactory
from .publication_factory import IPublicationFactory, PublicationFactory
from .synchronizer_factory import ISynchronizerFactory, SynchronizerFacto... | true | true |
08f00c740b06c8710a38933a98979335541b12da | 31,224 | py | Python | mmdet/models/custom_layers.py | FelixZhang7/miemiedetection | ca44f33255e0bb9d6150044983a344fb9a288c08 | [
"Apache-2.0"
] | null | null | null | mmdet/models/custom_layers.py | FelixZhang7/miemiedetection | ca44f33255e0bb9d6150044983a344fb9a288c08 | [
"Apache-2.0"
] | null | null | null | mmdet/models/custom_layers.py | FelixZhang7/miemiedetection | ca44f33255e0bb9d6150044983a344fb9a288c08 | [
"Apache-2.0"
] | 1 | 2022-02-16T08:35:00.000Z | 2022-02-16T08:35:00.000Z | #! /usr/bin/env python
# coding=utf-8
# ================================================================
#
# Author : miemie2013
# Created date:
# Description :
#
# ================================================================
import torch
import torch as T
import torch.nn.functional as F
import torch.nn ... | 39.324937 | 173 | 0.553068 | import torch
import torch as T
import torch.nn.functional as F
import torch.nn as nn
import numpy as np
def paddle_yolo_box(conv_output, anchors, stride, num_classes, scale_x_y, im_size, clip_bbox, conf_thresh):
conv_output = conv_output.permute(0, 2, 3, 1)
conv_shape = conv_output.shape
batch_size ... | true | true |
08f00cde8ae1f5fe7f98d12061902808cb0ff683 | 887 | py | Python | test/e2e/cws-tests/tests/lib/config.py | JacobHenner/datadog-agent | d835c6632650db55424ef7577e9a7e71659c44d3 | [
"Apache-2.0"
] | null | null | null | test/e2e/cws-tests/tests/lib/config.py | JacobHenner/datadog-agent | d835c6632650db55424ef7577e9a7e71659c44d3 | [
"Apache-2.0"
] | null | null | null | test/e2e/cws-tests/tests/lib/config.py | JacobHenner/datadog-agent | d835c6632650db55424ef7577e9a7e71659c44d3 | [
"Apache-2.0"
] | null | null | null | import tempfile
import yaml
def gen_system_probe_config(network_enabled=False, log_level="INFO", log_patterns=None):
fp = tempfile.NamedTemporaryFile(prefix="e2e-system-probe-", mode="w", delete=False)
if not log_patterns:
log_patterns = []
data = {
"system_probe_config": {"log_level": l... | 26.878788 | 96 | 0.660654 | import tempfile
import yaml
def gen_system_probe_config(network_enabled=False, log_level="INFO", log_patterns=None):
fp = tempfile.NamedTemporaryFile(prefix="e2e-system-probe-", mode="w", delete=False)
if not log_patterns:
log_patterns = []
data = {
"system_probe_config": {"log_level": l... | true | true |
08f00dbf4aacc55b5edaed77f3ecd8f7c6d8d82f | 82 | py | Python | molsysmt/element/group/lipid/lipid_names.py | uibcdf/MolModMTs | 4f6b6f671a9fa3e73008d1e9c48686d5f20a6573 | [
"MIT"
] | null | null | null | molsysmt/element/group/lipid/lipid_names.py | uibcdf/MolModMTs | 4f6b6f671a9fa3e73008d1e9c48686d5f20a6573 | [
"MIT"
] | null | null | null | molsysmt/element/group/lipid/lipid_names.py | uibcdf/MolModMTs | 4f6b6f671a9fa3e73008d1e9c48686d5f20a6573 | [
"MIT"
] | null | null | null | lipid_names = [
'POPC',
'DOPC',
'DSPC',
'DMPC'
]
| 10.25 | 15 | 0.329268 | lipid_names = [
'POPC',
'DOPC',
'DSPC',
'DMPC'
]
| true | true |
08f00de91ccd6e385ef8e31d8cc93b6c026818c0 | 1,280 | py | Python | apps/accounts/admin.py | ramseylove/project_management_api | 9c76c4464baf7f9af6c977a42ccd7eb3ce205c7b | [
"MIT"
] | null | null | null | apps/accounts/admin.py | ramseylove/project_management_api | 9c76c4464baf7f9af6c977a42ccd7eb3ce205c7b | [
"MIT"
] | null | null | null | apps/accounts/admin.py | ramseylove/project_management_api | 9c76c4464baf7f9af6c977a42ccd7eb3ce205c7b | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.contrib.auth import get_user_model
from django.contrib.auth.admin import UserAdmin
from .models import UserProfile
from .forms import CustomUserCreationForm, CustomUserChangeForm
CustomUser = get_user_model()
class UserProfileAdmin(admin.StackedInline):
model = UserP... | 26.122449 | 92 | 0.655469 | from django.contrib import admin
from django.contrib.auth import get_user_model
from django.contrib.auth.admin import UserAdmin
from .models import UserProfile
from .forms import CustomUserCreationForm, CustomUserChangeForm
CustomUser = get_user_model()
class UserProfileAdmin(admin.StackedInline):
model = UserP... | true | true |
08f00fa319bb33b6a0e693e7e68561e357bff5f8 | 7,042 | py | Python | ckanext/datastore/tests/test_helpers.py | depositar/ckan | f74dc413b550f09847df23bc3bad061a5258a0f1 | [
"Apache-2.0"
] | null | null | null | ckanext/datastore/tests/test_helpers.py | depositar/ckan | f74dc413b550f09847df23bc3bad061a5258a0f1 | [
"Apache-2.0"
] | null | null | null | ckanext/datastore/tests/test_helpers.py | depositar/ckan | f74dc413b550f09847df23bc3bad061a5258a0f1 | [
"Apache-2.0"
] | null | null | null | # encoding: utf-8
import re
import mock
import sqlalchemy.orm as orm
from sqlalchemy.exc import ProgrammingError
import nose
from nose.plugins.skip import SkipTest
from ckan.common import config
import ckanext.datastore.helpers as datastore_helpers
import ckanext.datastore.backend.postgres as postgres_backend
import... | 38.271739 | 141 | 0.56092 | import re
import mock
import sqlalchemy.orm as orm
from sqlalchemy.exc import ProgrammingError
import nose
from nose.plugins.skip import SkipTest
from ckan.common import config
import ckanext.datastore.helpers as datastore_helpers
import ckanext.datastore.backend.postgres as postgres_backend
import ckanext.datastore... | true | true |
08f010459b0f65a862a005f814a779346de424ec | 1,792 | py | Python | lambda/tools/bibNumber.py | epicfaace/GCMW | b06b41c1629866e334c8b2cd94d008bbc2028cdf | [
"Apache-2.0"
] | 2 | 2021-08-09T07:50:37.000Z | 2022-03-15T17:23:37.000Z | lambda/tools/bibNumber.py | ksankara/CFF | 70f10bb7abc0f381fa309379a85d2782ed6c36b8 | [
"Apache-2.0"
] | 114 | 2019-06-20T15:27:13.000Z | 2020-08-30T21:15:56.000Z | lambda/tools/bibNumber.py | epicfaace/GCMW | b06b41c1629866e334c8b2cd94d008bbc2028cdf | [
"Apache-2.0"
] | 7 | 2019-07-20T06:11:19.000Z | 2020-06-28T15:23:14.000Z | from chalicelib.models import (
Response,
Form,
PaymentTrailItem,
PaymentStatusDetailItem,
serialize_model,
)
from chalicelib.main import app, MODE
"""
pipenv run python -m unittest tools.bibNumber
Renames fields
"""
import os
import dateutil.parser
import boto3
import json
import datetime
from bso... | 26.746269 | 107 | 0.668527 | from chalicelib.models import (
Response,
Form,
PaymentTrailItem,
PaymentStatusDetailItem,
serialize_model,
)
from chalicelib.main import app, MODE
import os
import dateutil.parser
import boto3
import json
import datetime
from bson.objectid import ObjectId
from boto3.dynamodb.conditions import Key,... | true | true |
08f0106968ae6af77c6c045bbd3bf9553577d165 | 7,927 | py | Python | app.py | green10-syntra-ab-python-adv/cloudnative-ch04 | e1ee1690d06fb3e80c54699e4276577bf647327d | [
"BSD-2-Clause"
] | null | null | null | app.py | green10-syntra-ab-python-adv/cloudnative-ch04 | e1ee1690d06fb3e80c54699e4276577bf647327d | [
"BSD-2-Clause"
] | null | null | null | app.py | green10-syntra-ab-python-adv/cloudnative-ch04 | e1ee1690d06fb3e80c54699e4276577bf647327d | [
"BSD-2-Clause"
] | null | null | null | # Importing modules
from flask import Flask, render_template, request, jsonify, redirect, session
from flask import abort
from flask_cors import CORS
from flask import make_response, url_for
import random
from pymongo import MongoClient
from time import gmtime, strftime
# connection to MongoDB Database
connection = Mo... | 26.962585 | 88 | 0.611202 | from flask import Flask, render_template, request, jsonify, redirect, session
from flask import abort
from flask_cors import CORS
from flask import make_response, url_for
import random
from pymongo import MongoClient
from time import gmtime, strftime
connection = MongoClient("mongodb://localhost:27017/")
app = Flask(... | true | true |
08f0106be79dcfe96516b70f9d0bb6412ed2d355 | 317 | py | Python | backend/audits/urls.py | donroyco/falco | 305889f867907660c8a67e6f40b38289dcd22ab7 | [
"MIT"
] | 796 | 2019-10-19T19:58:12.000Z | 2022-03-22T14:02:37.000Z | backend/audits/urls.py | Johann-S/falco | c4713d0ab38f3a8a4601b1594fd22a4be170933d | [
"MIT"
] | 224 | 2019-10-19T17:45:12.000Z | 2022-03-24T20:46:29.000Z | backend/audits/urls.py | Johann-S/falco | c4713d0ab38f3a8a4601b1594fd22a4be170933d | [
"MIT"
] | 33 | 2019-10-22T21:17:09.000Z | 2021-12-23T06:08:26.000Z | from audits import views
from django.urls import path
app_name = "audits"
urlpatterns = [
path("<uuid:project_uuid>/request", views.request_audit),
path("<uuid:audit_uuid>/status", views.audit_status),
path("<uuid:audit_uuid>/results", views.audit_results),
path("results", views.audits_results),
]
| 26.416667 | 61 | 0.722397 | from audits import views
from django.urls import path
app_name = "audits"
urlpatterns = [
path("<uuid:project_uuid>/request", views.request_audit),
path("<uuid:audit_uuid>/status", views.audit_status),
path("<uuid:audit_uuid>/results", views.audit_results),
path("results", views.audits_results),
]
| true | true |
08f0109dceeb712d070aefd2aa717ca0fe027d59 | 7,793 | py | Python | celery/events/__init__.py | frac/celery | b6b32ca9a951e81722c52412c3f8a1cff67109dd | [
"BSD-3-Clause"
] | 1 | 2015-11-05T02:49:59.000Z | 2015-11-05T02:49:59.000Z | celery/events/__init__.py | frac/celery | b6b32ca9a951e81722c52412c3f8a1cff67109dd | [
"BSD-3-Clause"
] | null | null | null | celery/events/__init__.py | frac/celery | b6b32ca9a951e81722c52412c3f8a1cff67109dd | [
"BSD-3-Clause"
] | null | null | null | import time
import socket
import threading
from collections import deque
from itertools import count
from kombu.entity import Exchange, Queue
from kombu.messaging import Consumer, Producer
from celery.app import app_or_default
from celery.utils import gen_unique_id
event_exchange = Exchange("celeryev", type="topic"... | 31.678862 | 79 | 0.580649 | import time
import socket
import threading
from collections import deque
from itertools import count
from kombu.entity import Exchange, Queue
from kombu.messaging import Consumer, Producer
from celery.app import app_or_default
from celery.utils import gen_unique_id
event_exchange = Exchange("celeryev", type="topic"... | false | true |
08f010d083993cab9281a8a93e3af8220fad83cb | 4,664 | py | Python | lino_xl/lib/lists/models.py | khchine5/xl | b1634937a9ce87af1e948eb712b934b11f221d9d | [
"BSD-2-Clause"
] | 1 | 2018-01-12T14:09:48.000Z | 2018-01-12T14:09:48.000Z | lino_xl/lib/lists/models.py | khchine5/xl | b1634937a9ce87af1e948eb712b934b11f221d9d | [
"BSD-2-Clause"
] | 1 | 2019-09-10T05:03:47.000Z | 2019-09-10T05:03:47.000Z | lino_xl/lib/lists/models.py | khchine5/xl | b1634937a9ce87af1e948eb712b934b11f221d9d | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: UTF-8 -*-
# Copyright 2014-2017 Luc Saffre
#
# License: BSD (see file COPYING for details)
"""The :xfile:`models.py` module for the :mod:`lino_xl.lib.lists` app.
This module defines the tables
- :class:`List`
- :class:`Membership`
"""
from __future__ import unicode_literals
import logging
logger = ... | 25.767956 | 70 | 0.680532 |
from __future__ import unicode_literals
import logging
logger = logging.getLogger(__name__)
from django.db import models
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import string_concat
from lino_xl.lib.contacts.roles import ContactsStaff... | true | true |
08f0123f2e2a2dbee40257923ba17cb01b304b06 | 491 | py | Python | tokens.py | OJP98/py-simple-parser | 91717ceae4120d375524c4474ec3d421b5608b82 | [
"MIT"
] | null | null | null | tokens.py | OJP98/py-simple-parser | 91717ceae4120d375524c4474ec3d421b5608b82 | [
"MIT"
] | null | null | null | tokens.py | OJP98/py-simple-parser | 91717ceae4120d375524c4474ec3d421b5608b82 | [
"MIT"
] | null | null | null | from enum import Enum
class TokenType(Enum):
NUMBER = 0
MINUS = 1
PLUS = 2
DIVISION = 3
MULTIPLY = 4
POW = 5
LPAR = 6
RPAR = 6
class Token:
def __init__(self, type: TokenType, value=None):
self.type = type
self.value = value
self.precedence = type.value
... | 18.884615 | 52 | 0.556008 | from enum import Enum
class TokenType(Enum):
NUMBER = 0
MINUS = 1
PLUS = 2
DIVISION = 3
MULTIPLY = 4
POW = 5
LPAR = 6
RPAR = 6
class Token:
def __init__(self, type: TokenType, value=None):
self.type = type
self.value = value
self.precedence = type.value
... | true | true |
08f01246c2cc76d47486693a8b85badc4497931b | 61 | py | Python | get_bit.py | wfehrnstrom/harmonize | e5661d24b2021739e8ac4bf1d3a530eda4e155b3 | [
"MIT"
] | null | null | null | get_bit.py | wfehrnstrom/harmonize | e5661d24b2021739e8ac4bf1d3a530eda4e155b3 | [
"MIT"
] | null | null | null | get_bit.py | wfehrnstrom/harmonize | e5661d24b2021739e8ac4bf1d3a530eda4e155b3 | [
"MIT"
] | null | null | null | def get_bit(byteval,idx):
return ((byteval&(1<<idx))!=0); | 30.5 | 35 | 0.622951 | def get_bit(byteval,idx):
return ((byteval&(1<<idx))!=0); | true | true |
08f01262d3b86884a17be137c89c05a00a62244f | 292 | py | Python | output/models/nist_data/atomic/negative_integer/schema_instance/nistschema_sv_iv_atomic_negative_integer_pattern_5_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/nist_data/atomic/negative_integer/schema_instance/nistschema_sv_iv_atomic_negative_integer_pattern_5_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/nist_data/atomic/negative_integer/schema_instance/nistschema_sv_iv_atomic_negative_integer_pattern_5_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from output.models.nist_data.atomic.negative_integer.schema_instance.nistschema_sv_iv_atomic_negative_integer_pattern_5_xsd.nistschema_sv_iv_atomic_negative_integer_pattern_5 import NistschemaSvIvAtomicNegativeIntegerPattern5
__all__ = [
"NistschemaSvIvAtomicNegativeIntegerPattern5",
]
| 48.666667 | 225 | 0.907534 | from output.models.nist_data.atomic.negative_integer.schema_instance.nistschema_sv_iv_atomic_negative_integer_pattern_5_xsd.nistschema_sv_iv_atomic_negative_integer_pattern_5 import NistschemaSvIvAtomicNegativeIntegerPattern5
__all__ = [
"NistschemaSvIvAtomicNegativeIntegerPattern5",
]
| true | true |
08f012dc652bac464c675b243ccad91d0a7c59e6 | 1,641 | py | Python | tests/policies/test_greedy_policy.py | davidrobles/myelin | af76d4ec41f9b4f9be42fc12094aab6f879db770 | [
"MIT"
] | null | null | null | tests/policies/test_greedy_policy.py | davidrobles/myelin | af76d4ec41f9b4f9be42fc12094aab6f879db770 | [
"MIT"
] | 9 | 2020-03-24T15:46:12.000Z | 2021-09-11T16:23:59.000Z | tests/policies/test_greedy_policy.py | davidrobles/myelin | af76d4ec41f9b4f9be42fc12094aab6f879db770 | [
"MIT"
] | null | null | null | import unittest
from myelin.policies import Greedy
from myelin.value_functions.tabular_vf import TabularVF
class TestGreedyPolicy(unittest.TestCase):
def setUp(self):
def action_space(state):
actions = {
'north': [1, 4, 5, 8],
'south': [2, 3, 4]
}
... | 39.071429 | 70 | 0.645338 | import unittest
from myelin.policies import Greedy
from myelin.value_functions.tabular_vf import TabularVF
class TestGreedyPolicy(unittest.TestCase):
def setUp(self):
def action_space(state):
actions = {
'north': [1, 4, 5, 8],
'south': [2, 3, 4]
}
... | true | true |
08f013dd7c0c5eb7cd7684f9b3219a9fd1f579f7 | 2,651 | py | Python | my_plugins/YouCompleteMe/third_party/ycmd/ycmd/tests/go/get_completions_test.py | cyx233/vim_config | f09c9206344c17df20a05dd2c08a02f098a7e873 | [
"MIT"
] | null | null | null | my_plugins/YouCompleteMe/third_party/ycmd/ycmd/tests/go/get_completions_test.py | cyx233/vim_config | f09c9206344c17df20a05dd2c08a02f098a7e873 | [
"MIT"
] | null | null | null | my_plugins/YouCompleteMe/third_party/ycmd/ycmd/tests/go/get_completions_test.py | cyx233/vim_config | f09c9206344c17df20a05dd2c08a02f098a7e873 | [
"MIT"
] | null | null | null | # encoding: utf-8
#
# Copyright (C) 2015-2018 ycmd contributors
#
# This file is part of ycmd.
#
# ycmd is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | 37.871429 | 80 | 0.545077 |
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from builtins import * # noqa
from hamcrest import all_of, assert_that, has_items
from ycmd.tests.go import PathToTestFile, SharedYcmd
from ycmd.tests.test_utils impor... | true | true |
08f01568a2d443880f89584df46bb8114f39ee42 | 767 | py | Python | categories_api/categories/views.py | spanickroon/Categories-API | dc4a3f8e3ba9aa6f836f5d5a8dc3368abc11bac6 | [
"MIT"
] | null | null | null | categories_api/categories/views.py | spanickroon/Categories-API | dc4a3f8e3ba9aa6f836f5d5a8dc3368abc11bac6 | [
"MIT"
] | 1 | 2021-01-12T10:34:46.000Z | 2021-01-12T10:53:08.000Z | categories_api/categories/views.py | spanickroon/Categories-API | dc4a3f8e3ba9aa6f836f5d5a8dc3368abc11bac6 | [
"MIT"
] | null | null | null | """The module in which the views of the category application are located."""
from rest_framework.response import Response
from rest_framework import viewsets
from .serializers import CategoriesCreateSerializer, CategoriesSerializer
from .models import Category
class CategoriesCreateViewSet(viewsets.ModelViewSet):
... | 30.68 | 76 | 0.764016 |
from rest_framework.response import Response
from rest_framework import viewsets
from .serializers import CategoriesCreateSerializer, CategoriesSerializer
from .models import Category
class CategoriesCreateViewSet(viewsets.ModelViewSet):
serializer_class = CategoriesCreateSerializer
class CategoriesViewSet(v... | true | true |
08f01611f07dac0892cdfa2e4c4002962f7d8f52 | 7,836 | py | Python | docs/conf.py | cemunds/ifcnet-models | f224ddf74fe81ab7ce8a8671865841775eab2301 | [
"MIT"
] | 12 | 2021-06-18T10:30:43.000Z | 2021-12-13T13:39:28.000Z | docs/conf.py | RWTH-E3D/ifcnet-models | 1b00ea9a4f534dade4443ceae91b1bc9725290d6 | [
"MIT"
] | 2 | 2021-11-21T15:38:05.000Z | 2021-11-25T10:34:37.000Z | docs/conf.py | RWTH-E3D/ifcnet-models | 1b00ea9a4f534dade4443ceae91b1bc9725290d6 | [
"MIT"
] | 3 | 2021-11-25T11:34:17.000Z | 2022-01-04T03:26:08.000Z | # -*- coding: utf-8 -*-
#
# ifcnet-models documentation build configuration file, created by
# sphinx-quickstart.
#
# 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
# autogenerated file.
#
# All configuration values ... | 31.983673 | 80 | 0.707759 |
import os
import sys
extensions = []
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'ifcnet-models'
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '0.1'
# The full version, including a... | true | true |
08f016508f48832518470054266baf4a83e8975d | 1,043 | py | Python | setup.py | pylipp/qtilities | dc4595d066e69394125b0fe534027dbb6feaf32b | [
"MIT"
] | 5 | 2019-06-10T23:08:15.000Z | 2022-02-24T13:59:03.000Z | setup.py | pylipp/qtilities | dc4595d066e69394125b0fe534027dbb6feaf32b | [
"MIT"
] | 3 | 2018-07-11T14:08:07.000Z | 2021-01-14T21:09:10.000Z | setup.py | pylipp/qtilities | dc4595d066e69394125b0fe534027dbb6feaf32b | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
with open("README.md") as readme:
long_description = readme.read()
setup(
name='qtilities',
use_scm_version=True,
setup_requires=["setuptools_scm"],
description='Utilities for PyQt5 development',
long_description=long_description,
long_descriptio... | 27.447368 | 58 | 0.602109 | from setuptools import setup, find_packages
with open("README.md") as readme:
long_description = readme.read()
setup(
name='qtilities',
use_scm_version=True,
setup_requires=["setuptools_scm"],
description='Utilities for PyQt5 development',
long_description=long_description,
long_descriptio... | true | true |
08f017559f00fc8180119b4ad002fc25b2d37638 | 7,198 | py | Python | sandman/model/utils.py | shlomif/sandman | 31d276adbbd64c28081ae1d2e2b7e4e1efff3930 | [
"Apache-2.0"
] | 1 | 2018-10-28T06:04:10.000Z | 2018-10-28T06:04:10.000Z | sandman/model/utils.py | shlomif/sandman | 31d276adbbd64c28081ae1d2e2b7e4e1efff3930 | [
"Apache-2.0"
] | null | null | null | sandman/model/utils.py | shlomif/sandman | 31d276adbbd64c28081ae1d2e2b7e4e1efff3930 | [
"Apache-2.0"
] | null | null | null | """Various utility functions for registering and activating models."""
import webbrowser
from flask import current_app
from flask.ext.admin import Admin
from flask.ext.admin.contrib.sqla import ModelView
from sqlalchemy.engine import reflection
from sqlalchemy.ext.declarative import declarative_base, DeferredReflectio... | 41.367816 | 108 | 0.664351 | """Various utility functions for registering and activating models."""
import webbrowser
from flask import current_app
from flask.ext.admin import Admin
from flask.ext.admin.contrib.sqla import ModelView
from sqlalchemy.engine import reflection
from sqlalchemy.ext.declarative import declarative_base, DeferredReflectio... | false | true |
08f017851a1f674debf9ee48004011a7e70b13d6 | 1,931 | py | Python | tests/interpolators/test_vault.py | schireson/configly | fdf7d8a068a8442fb5b9bb09bbebd5091b004bfd | [
"MIT"
] | 6 | 2020-03-16T20:14:50.000Z | 2022-03-20T04:04:44.000Z | tests/interpolators/test_vault.py | schireson/configly | fdf7d8a068a8442fb5b9bb09bbebd5091b004bfd | [
"MIT"
] | 2 | 2021-09-03T21:42:03.000Z | 2022-01-06T19:08:15.000Z | tests/interpolators/test_vault.py | schireson/configly | 49b05836b655ad48a6401354093370e9fde0fdad | [
"MIT"
] | null | null | null | import json
import textwrap
from unittest.mock import mock_open, patch
import pytest
import responses
from configly import get_package_name
from configly.config import Config, post_process
from configly.interpolators.vault import VaultInterpolator
from configly.loaders import YamlLoader
yaml = YamlLoader()
def moc... | 23.26506 | 99 | 0.631279 | import json
import textwrap
from unittest.mock import mock_open, patch
import pytest
import responses
from configly import get_package_name
from configly.config import Config, post_process
from configly.interpolators.vault import VaultInterpolator
from configly.loaders import YamlLoader
yaml = YamlLoader()
def moc... | true | true |
08f01799e7e211df904cdad700b8afb986f0ec55 | 4,065 | py | Python | uwsgiconf/runtime/caching.py | idlesign/uwsgiconf | b0c74de57ccff2859bd26817dedc9a9cfb7f653f | [
"BSD-3-Clause"
] | 77 | 2017-07-15T21:14:24.000Z | 2021-09-02T13:35:44.000Z | uwsgiconf/runtime/caching.py | idlesign/uwsgiconf | b0c74de57ccff2859bd26817dedc9a9cfb7f653f | [
"BSD-3-Clause"
] | 5 | 2017-12-01T05:41:02.000Z | 2022-03-23T07:46:19.000Z | uwsgiconf/runtime/caching.py | idlesign/uwsgiconf | b0c74de57ccff2859bd26817dedc9a9cfb7f653f | [
"BSD-3-Clause"
] | 1 | 2021-05-20T01:33:04.000Z | 2021-05-20T01:33:04.000Z | from typing import List, Any, Callable
from .. import uwsgi
from ..typehints import Strint
from ..utils import decode, decode_deep
class Cache:
"""Interface for uWSGI Caching subsystem.
.. warning:: To use this helper one needs
to configure cache(s) in uWSGI config beforehand.
E.g.: ``secti... | 26.225806 | 109 | 0.582042 | from typing import List, Any, Callable
from .. import uwsgi
from ..typehints import Strint
from ..utils import decode, decode_deep
class Cache:
__slots__ = ['name', 'timeout']
def __init__(self, name: str, *, timeout: int = None):
self.timeout = timeout or 300
self.name = name
def __con... | true | true |
08f0196d0f75361874a0337e77de5406589a73f6 | 74 | py | Python | src/constants/FileTypeIdentifier.py | Zauras/FBX-model-fetcher-blender-based | a788593eedf83aaa40106d153e6474d3fe552c47 | [
"MIT"
] | null | null | null | src/constants/FileTypeIdentifier.py | Zauras/FBX-model-fetcher-blender-based | a788593eedf83aaa40106d153e6474d3fe552c47 | [
"MIT"
] | null | null | null | src/constants/FileTypeIdentifier.py | Zauras/FBX-model-fetcher-blender-based | a788593eedf83aaa40106d153e6474d3fe552c47 | [
"MIT"
] | null | null | null | from enum import Enum
class FileTypeIdentifier(Enum):
Texture = 'T'
| 12.333333 | 31 | 0.716216 | from enum import Enum
class FileTypeIdentifier(Enum):
Texture = 'T'
| true | true |
08f0198a70fdd6131d446c732bae2ed512d75607 | 559 | py | Python | somos.py | CzA11/somos | cab4802626eaa7aca41da029a8efdeeedfbc50b4 | [
"MIT"
] | null | null | null | somos.py | CzA11/somos | cab4802626eaa7aca41da029a8efdeeedfbc50b4 | [
"MIT"
] | null | null | null | somos.py | CzA11/somos | cab4802626eaa7aca41da029a8efdeeedfbc50b4 | [
"MIT"
] | null | null | null | import sys
v = sys.version
if "2.7" in v:
from Tkinter import *
import tkFileDialog
else:
from tkinter import *
import tkinter.filedialog
i_am_root = Tk("Somos")
text = Text(i_am_root)
text.grid()
def save_as_option():
global text
text_grab = text.get('1.0', 'end-1c')
location_of_file_save ... | 24.304348 | 73 | 0.703041 | import sys
v = sys.version
if "2.7" in v:
from Tkinter import *
import tkFileDialog
else:
from tkinter import *
import tkinter.filedialog
i_am_root = Tk("Somos")
text = Text(i_am_root)
text.grid()
def save_as_option():
global text
text_grab = text.get('1.0', 'end-1c')
location_of_file_save ... | true | true |
08f01a1fe620ca8c5f4f93275521ec1874c0a6d4 | 13,181 | py | Python | detectron2/data/datasets/cityscapes.py | aminekechaou/detectron2 | 3772b9316f8a2e6bf55cf5868dd64214d7f7c49a | [
"Apache-2.0"
] | null | null | null | detectron2/data/datasets/cityscapes.py | aminekechaou/detectron2 | 3772b9316f8a2e6bf55cf5868dd64214d7f7c49a | [
"Apache-2.0"
] | null | null | null | detectron2/data/datasets/cityscapes.py | aminekechaou/detectron2 | 3772b9316f8a2e6bf55cf5868dd64214d7f7c49a | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import functools
import json
import logging
import multiprocessing as mp
import numpy as np
import os
from itertools import chain
import pycocotools.mask as mask_util
from PIL import Image
from detectron2.structures import BoxMode
from detectron2.u... | 39.942424 | 125 | 0.629998 | import functools
import json
import logging
import multiprocessing as mp
import numpy as np
import os
from itertools import chain
import pycocotools.mask as mask_util
from PIL import Image
from detectron2.structures import BoxMode
from detectron2.utils.comm import get_world_size
from detectron2.utils.file_io import Pa... | true | true |
08f01ab5cbda7febba2ca4c218f53894e157e970 | 5,253 | py | Python | altimeter/core/log.py | AmOr1984v02/altimeter | 4adcf8d759b1f3f615b00521cc1756c8007e04f3 | [
"MIT"
] | null | null | null | altimeter/core/log.py | AmOr1984v02/altimeter | 4adcf8d759b1f3f615b00521cc1756c8007e04f3 | [
"MIT"
] | null | null | null | altimeter/core/log.py | AmOr1984v02/altimeter | 4adcf8d759b1f3f615b00521cc1756c8007e04f3 | [
"MIT"
] | null | null | null | """Provides a class Logger with methods for logging."""
from contextlib import contextmanager
from dataclasses import dataclass
import logging
import os
import sys
import threading
from typing import cast, Any, Dict, List, Tuple, Type, Union
import structlog
@dataclass(frozen=True)
class EventName:
"""Dataclass ... | 31.644578 | 97 | 0.632972 | from contextlib import contextmanager
from dataclasses import dataclass
import logging
import os
import sys
import threading
from typing import cast, Any, Dict, List, Tuple, Type, Union
import structlog
@dataclass(frozen=True)
class EventName:
name: str
class LogEventMeta(type):
def __new__(
mcs,... | true | true |
08f01b711d8d3de9fa723a7e7f2622558ff2a5e2 | 1,498 | py | Python | wwsync/add_user.py | devrdander/weight-watchers-sync | f056ac7ae6aed1a2a49eadfdbbf9de5100f07201 | [
"MIT"
] | 9 | 2016-03-30T14:02:34.000Z | 2021-09-26T11:41:06.000Z | wwsync/add_user.py | devrdander/weight-watchers-sync | f056ac7ae6aed1a2a49eadfdbbf9de5100f07201 | [
"MIT"
] | 2 | 2016-04-24T00:13:12.000Z | 2020-09-26T17:35:30.000Z | wwsync/add_user.py | devrdander/weight-watchers-sync | f056ac7ae6aed1a2a49eadfdbbf9de5100f07201 | [
"MIT"
] | 13 | 2016-04-23T21:06:37.000Z | 2021-12-07T18:51:22.000Z | import json
import os
import sys
from getpass import getpass
from wwsync.encrypt import encrypt
from wwsync.fitbit import auth
from wwsync.models import User, get_db_session
def main():
db_session = get_db_session()
client_id = os.environ['WW_FB_ID']
fb_secret = os.environ['WW_FB_SECRET']
print("Th... | 37.45 | 111 | 0.73498 | import json
import os
import sys
from getpass import getpass
from wwsync.encrypt import encrypt
from wwsync.fitbit import auth
from wwsync.models import User, get_db_session
def main():
db_session = get_db_session()
client_id = os.environ['WW_FB_ID']
fb_secret = os.environ['WW_FB_SECRET']
print("Th... | true | true |
08f01bb48e17642c9553111791e71ba61d454d6b | 331,666 | py | Python | cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_infra_policymgr_cfg.py | tkamata-test/ydk-py | b637e7853a8edbbd31fbc05afa3aa4110b31c5f9 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_infra_policymgr_cfg.py | tkamata-test/ydk-py | b637e7853a8edbbd31fbc05afa3aa4110b31c5f9 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_infra_policymgr_cfg.py | tkamata-test/ydk-py | b637e7853a8edbbd31fbc05afa3aa4110b31c5f9 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | """ Cisco_IOS_XR_infra_policymgr_cfg
This module contains a collection of YANG definitions
for Cisco IOS\-XR ASR9k policy manager configuration.
Copyright (c) 2013, 2015\-2016 by Cisco Systems, Inc.
All rights reserved.
"""
import re
import collections
from enum import Enum
from ydk.types import Empty, YList, ... | 41.210984 | 482 | 0.40223 |
import re
import collections
from enum import Enum
from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict
from ydk.errors import YPYError, YPYModelError
class AuthorizeIdentifierEnum(Enum):
circuit_id = 0
dhcp_client_id = 1
remote_id = 2
source_address_ipv4 = 3
... | true | true |
08f01c788bd354bdaae747ef92aad61bc7432379 | 246 | py | Python | pixel/utils/file.py | filipsedivy/pixel.py | 95aa3373d56cee1ddfd14c418e10ff170159ef18 | [
"Apache-2.0"
] | 5 | 2021-12-18T23:32:16.000Z | 2022-01-02T20:56:25.000Z | pixel/utils/file.py | filipsedivy/pixel.py | 95aa3373d56cee1ddfd14c418e10ff170159ef18 | [
"Apache-2.0"
] | null | null | null | pixel/utils/file.py | filipsedivy/pixel.py | 95aa3373d56cee1ddfd14c418e10ff170159ef18 | [
"Apache-2.0"
] | null | null | null | import os
import hashlib
def md5_file(file_path) -> str:
if os.path.exists(file_path) is False:
raise FileNotFoundError("File not found: " + file_path)
with open(file_path, 'rb') as f:
return hashlib.md5(f).hexdigest()
| 22.363636 | 63 | 0.670732 | import os
import hashlib
def md5_file(file_path) -> str:
if os.path.exists(file_path) is False:
raise FileNotFoundError("File not found: " + file_path)
with open(file_path, 'rb') as f:
return hashlib.md5(f).hexdigest()
| true | true |
08f01d00440ffbc1077a68cb8ff74a6412ab032b | 4,795 | py | Python | discord/file.py | StockerMC/discord.py_ | 5b864f6c6709b20e04b519568dd4fb8107dc8658 | [
"MIT"
] | 7 | 2021-09-22T01:01:19.000Z | 2022-02-21T20:31:35.000Z | discord/file.py | StockerMC/discord.py_ | 5b864f6c6709b20e04b519568dd4fb8107dc8658 | [
"MIT"
] | 4 | 2021-11-11T18:37:31.000Z | 2022-02-16T01:49:36.000Z | discord/file.py | StockerMC/discord.py_ | 5b864f6c6709b20e04b519568dd4fb8107dc8658 | [
"MIT"
] | 3 | 2021-11-30T13:44:53.000Z | 2022-02-11T03:07:20.000Z | """
The MIT License (MIT)
Copyright (c) 2015-present Rapptz
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merg... | 33.767606 | 108 | 0.635871 |
from __future__ import annotations
from typing import Optional, TYPE_CHECKING, Union, Callable
import os
import io
__all__ = (
'File',
)
class File:
__slots__ = (
'fp',
'filename',
'spoiler',
'description',
'_original_pos',
'_owner',
'_closer',
)... | true | true |
08f01fd3abbadcca21e77e4d80b4364192ccabc3 | 1,601 | py | Python | tests/conftest.py | ChristophAlt/StAn | abb115b9f245c66edbb3bb89ee45cdc654a48709 | [
"MIT"
] | 3 | 2019-04-23T08:07:15.000Z | 2020-01-09T07:22:27.000Z | tests/conftest.py | ChristophAlt/StAn | abb115b9f245c66edbb3bb89ee45cdc654a48709 | [
"MIT"
] | null | null | null | tests/conftest.py | ChristophAlt/StAn | abb115b9f245c66edbb3bb89ee45cdc654a48709 | [
"MIT"
] | 2 | 2019-06-27T08:40:23.000Z | 2020-01-09T07:22:30.000Z | import pytest
import os
import logging
import json
import stanfordcorenlp
from tests import FIXTURES_ROOT
from stan.annotators.corenlp import CoreNlpAnnotator
from stan.dataset_annotators.semeval2010_task8 import Semeval2010Task8Annotator
from stan.dataset_readers.semeval2010_task8 import SemEval2010Task8DatasetReade... | 32.02 | 80 | 0.750156 | import pytest
import os
import logging
import json
import stanfordcorenlp
from tests import FIXTURES_ROOT
from stan.annotators.corenlp import CoreNlpAnnotator
from stan.dataset_annotators.semeval2010_task8 import Semeval2010Task8Annotator
from stan.dataset_readers.semeval2010_task8 import SemEval2010Task8DatasetReade... | true | true |
08f02057c16830fb2d34b7e32cfc9709d8a60c5a | 3,676 | py | Python | saliency/grad_cam.py | chuyj/saliency | 878680dd326f983b051fc33dd6212f28f1d9a7a7 | [
"Apache-2.0"
] | null | null | null | saliency/grad_cam.py | chuyj/saliency | 878680dd326f983b051fc33dd6212f28f1d9a7a7 | [
"Apache-2.0"
] | null | null | null | saliency/grad_cam.py | chuyj/saliency | 878680dd326f983b051fc33dd6212f28f1d9a7a7 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Ruth Fong. 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 applicable law or agr... | 39.106383 | 97 | 0.629489 |
import numpy as np
import tensorflow as tf
from .base import SaliencyMask
class GradCam(SaliencyMask):
def __init__(self, graph, session, y, x, conv_layer):
super(GradCam, self).__init__(graph, session, y, x)
self.conv_layer = conv_layer
self.gradients_node = tf.gradients(y, conv_layer)... | true | true |
08f0248d6d405ab585be57cc1486783566828799 | 629 | py | Python | my_charts/manage.py | Vozak16/Gmail-Manager | 4de52760888151f05a7fef172b8c61a33b08b78d | [
"MIT"
] | 2 | 2021-03-30T15:16:19.000Z | 2021-03-30T15:32:57.000Z | my_charts/manage.py | Vozak16/Gmail-Manager | 4de52760888151f05a7fef172b8c61a33b08b78d | [
"MIT"
] | 12 | 2020-05-01T13:46:02.000Z | 2022-03-12T00:30:39.000Z | my_charts/manage.py | Vozak16/Gmail-Manager | 4de52760888151f05a7fef172b8c61a33b08b78d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'my_charts.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise Impo... | 28.590909 | 73 | 0.683625 | import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'my_charts.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
... | true | true |
08f024a41ae460933b3e25d47b7c9bc4b84e9f10 | 43 | py | Python | managers/operatorsReadNWB/__init__.py | HarshKhilawala/cerebmodels | d2a2f2ef947ef9dc23ddce6e55159240cd3233cb | [
"BSD-3-Clause"
] | null | null | null | managers/operatorsReadNWB/__init__.py | HarshKhilawala/cerebmodels | d2a2f2ef947ef9dc23ddce6e55159240cd3233cb | [
"BSD-3-Clause"
] | 9 | 2020-03-24T17:09:03.000Z | 2021-05-17T16:11:17.000Z | managers/operatorsReadNWB/__init__.py | myHBPwork/cerebmodels | 371ea7f1bbe388f1acade17c7128b8ca6ab8fb7a | [
"BSD-3-Clause"
] | 1 | 2021-05-21T03:08:41.000Z | 2021-05-21T03:08:41.000Z | # ../managers/operatorsReadNWB/__init__.py
| 21.5 | 42 | 0.790698 | true | true | |
08f024b855be32655f365f250d6573876dd017fc | 9,810 | py | Python | reports/configs/only_logp_gin3_1/other_config.py | hengwei-chan/graph_network_demo | 542f2a59b1b9708abdc718d77db7111f3ba2df96 | [
"MIT"
] | 1 | 2021-10-18T03:44:53.000Z | 2021-10-18T03:44:53.000Z | reports/configs/only_logp_gin3_1/other_config.py | hengwei-chan/graph_network_demo | 542f2a59b1b9708abdc718d77db7111f3ba2df96 | [
"MIT"
] | null | null | null | reports/configs/only_logp_gin3_1/other_config.py | hengwei-chan/graph_network_demo | 542f2a59b1b9708abdc718d77db7111f3ba2df96 | [
"MIT"
] | 1 | 2022-02-22T08:32:01.000Z | 2022-02-22T08:32:01.000Z | from dataclasses import dataclass, field
from typing import List
import tensorflow as tf
from graph_networks.utilities import *
import logging
import os
ATOM_FEATURE_DIM = DGIN3_ATOM_FEATURE_DIM
EDGE_FEATURE_DIM = DGIN3_EDGE_FEATURE_DIM
@dataclass
class BasicModelConfig:
"""
Config for model1/2/3 run file.
... | 43.991031 | 169 | 0.669623 | from dataclasses import dataclass, field
from typing import List
import tensorflow as tf
from graph_networks.utilities import *
import logging
import os
ATOM_FEATURE_DIM = DGIN3_ATOM_FEATURE_DIM
EDGE_FEATURE_DIM = DGIN3_EDGE_FEATURE_DIM
@dataclass
class BasicModelConfig:
model_name: str = 'only_logp_gin3_1' ... | true | true |
08f025126644bf84420999dc707c7dfd33e7c5ac | 2,131 | py | Python | SurfaceTopography/Nonuniform/common.py | ComputationalMechanics/SurfaceTopography | 6751be427c89d526ef4857300409596c79119029 | [
"MIT"
] | 5 | 2020-06-03T20:01:36.000Z | 2021-03-03T09:25:03.000Z | SurfaceTopography/Nonuniform/common.py | ContactEngineering/SurfaceTopography | 7dc7346cb9545326a3323fda0d402f254eae8c0e | [
"MIT"
] | 98 | 2021-03-29T11:13:27.000Z | 2022-03-18T10:37:37.000Z | SurfaceTopography/Nonuniform/common.py | ContactEngineering/SurfaceTopography | 7dc7346cb9545326a3323fda0d402f254eae8c0e | [
"MIT"
] | 2 | 2021-04-15T20:42:23.000Z | 2021-07-09T10:37:35.000Z | #
# Copyright 2018-2020 Lars Pastewka
# 2019 Antoine Sanner
# 2019 Michael Röttger
# 2015-2016 Till Junge
#
# ### MIT license
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# i... | 34.934426 | 79 | 0.740497 |
import numpy as np
from ..HeightContainer import NonuniformLineScanInterface
def bandwidth(self):
x = self.positions()
lower_bound = np.mean(np.diff(x))
upper_bound, = self.physical_sizes
return lower_bound, upper_bound
NonuniformLineScanInterface.register_function('bandwidth', bandwidth)
| true | true |
08f025828937b09a6f937df68d9dbbff08c7d560 | 966 | py | Python | datumaro/util/image_cache.py | detecttechnologies/datumaro | a00a4ec6807787d341c71f75f5e337c3cb7be119 | [
"MIT"
] | 1 | 2021-11-09T14:50:43.000Z | 2021-11-09T14:50:43.000Z | datumaro/util/image_cache.py | detecttechnologies/datumaro | a00a4ec6807787d341c71f75f5e337c3cb7be119 | [
"MIT"
] | null | null | null | datumaro/util/image_cache.py | detecttechnologies/datumaro | a00a4ec6807787d341c71f75f5e337c3cb7be119 | [
"MIT"
] | 9 | 2021-05-17T07:00:03.000Z | 2021-06-26T02:15:10.000Z | # Copyright (C) 2019-2020 Intel Corporation
#
# SPDX-License-Identifier: MIT
from collections import OrderedDict
_instance = None
DEFAULT_CAPACITY = 2
class ImageCache:
@staticmethod
def get_instance():
global _instance
if _instance is None:
_instance = ImageCache()
retu... | 23 | 70 | 0.625259 |
from collections import OrderedDict
_instance = None
DEFAULT_CAPACITY = 2
class ImageCache:
@staticmethod
def get_instance():
global _instance
if _instance is None:
_instance = ImageCache()
return _instance
def __init__(self, capacity=DEFAULT_CAPACITY):
self... | true | true |
08f026651d47c2413d69834a659661f0464e669f | 770 | py | Python | test/github_fetcher_test.py | searene/PLDetector | a8052b1d2ba91bfcc3fd4a5252480cf511d8a210 | [
"MIT"
] | 1 | 2020-11-09T08:24:17.000Z | 2020-11-09T08:24:17.000Z | test/github_fetcher_test.py | searene/PLDetector | a8052b1d2ba91bfcc3fd4a5252480cf511d8a210 | [
"MIT"
] | null | null | null | test/github_fetcher_test.py | searene/PLDetector | a8052b1d2ba91bfcc3fd4a5252480cf511d8a210 | [
"MIT"
] | null | null | null | import unittest
from typing import List
from src import config
from src.github_fetcher import GithubFetcher, extract_php
class GithubFetcherTest(unittest.TestCase):
def __init__(self, *args, **kwargs):
unittest.TestCase.__init__(self, *args, **kwargs)
self.github_fetcher = GithubFetcher(
... | 26.551724 | 91 | 0.64026 | import unittest
from typing import List
from src import config
from src.github_fetcher import GithubFetcher, extract_php
class GithubFetcherTest(unittest.TestCase):
def __init__(self, *args, **kwargs):
unittest.TestCase.__init__(self, *args, **kwargs)
self.github_fetcher = GithubFetcher(
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.