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 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f74cb4a31040ec189e062dc74da1673212a8916f | 5,870 | py | Python | astropy/visualization/wcsaxes/tests/test_display_world_coordinates.py | guntbert/astropy | f2d2add09e5b1638b2698f19a4d46fcca19e82be | [
"BSD-3-Clause"
] | null | null | null | astropy/visualization/wcsaxes/tests/test_display_world_coordinates.py | guntbert/astropy | f2d2add09e5b1638b2698f19a4d46fcca19e82be | [
"BSD-3-Clause"
] | 1 | 2019-09-09T21:53:24.000Z | 2019-09-09T21:53:24.000Z | astropy/visualization/wcsaxes/tests/test_display_world_coordinates.py | guntbert/astropy | f2d2add09e5b1638b2698f19a4d46fcca19e82be | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from astropy.visualization.wcsaxes.core import WCSAxes
import matplotlib.pyplot as plt
from matplotlib.backend_bases import KeyEvent
from astropy.wcs import WCS
from astropy.coordinates import FK5
from astropy.time import Time
from astropy.tests.image_tes... | 39.662162 | 83 | 0.664395 |
from astropy.visualization.wcsaxes.core import WCSAxes
import matplotlib.pyplot as plt
from matplotlib.backend_bases import KeyEvent
from astropy.wcs import WCS
from astropy.coordinates import FK5
from astropy.time import Time
from astropy.tests.image_tests import ignore_matplotlibrc
from .test_images import BaseIma... | true | true |
f74cb4ad063882beb20867df01a4a127d434ee58 | 3,300 | py | Python | dlkit/handcar/type/objects.py | UOC/dlkit | a9d265db67e81b9e0f405457464e762e2c03f769 | [
"MIT"
] | 2 | 2018-02-23T12:16:11.000Z | 2020-10-08T17:54:24.000Z | dlkit/handcar/type/objects.py | UOC/dlkit | a9d265db67e81b9e0f405457464e762e2c03f769 | [
"MIT"
] | 87 | 2017-04-21T18:57:15.000Z | 2021-12-13T19:43:57.000Z | dlkit/handcar/type/objects.py | UOC/dlkit | a9d265db67e81b9e0f405457464e762e2c03f769 | [
"MIT"
] | 1 | 2018-03-01T16:44:25.000Z | 2018-03-01T16:44:25.000Z | # -*- coding: utf-8 -*-
# This module contains all the Object classes used by the MIT Core Concept
# Catalog (MC3) Handcar based implementation of the OSID Type Service.
from ...abstract_osid.type import objects as abc_type_objects
from ..osid import objects as osid_objects
from .. import settings
from ..primitives i... | 35.869565 | 139 | 0.623636 |
from ...abstract_osid.type import objects as abc_type_objects
from ..osid import objects as osid_objects
from .. import settings
from ..primitives import Id, Type, DisplayText
from ..osid.osid_errors import NullArgument, InvalidArgument, NotFound, NoAccess, IllegalState, OperationFailed, Unimplemented, Unsupported... | true | true |
f74cb4f167c0516e1e372c17573355d28e273f73 | 11,173 | py | Python | tests/test_utils.py | elsadarwin/blencongbot | c0dd0b96613aeff794470eb0d9a56065e78400ee | [
"Apache-2.0"
] | null | null | null | tests/test_utils.py | elsadarwin/blencongbot | c0dd0b96613aeff794470eb0d9a56065e78400ee | [
"Apache-2.0"
] | null | null | null | tests/test_utils.py | elsadarwin/blencongbot | c0dd0b96613aeff794470eb0d9a56065e78400ee | [
"Apache-2.0"
] | null | null | null | import pytest
from telebot import types
from tululbot.utils import TululBot, lookup_kamusslang, lookup_urbandictionary, lookup_slang
from tululbot.types import Message
class TestTululBot:
def test_create_bot(self):
bot = TululBot('TOKEN')
assert bot._telebot is not None
assert bot._user... | 32.861765 | 94 | 0.621498 | import pytest
from telebot import types
from tululbot.utils import TululBot, lookup_kamusslang, lookup_urbandictionary, lookup_slang
from tululbot.types import Message
class TestTululBot:
def test_create_bot(self):
bot = TululBot('TOKEN')
assert bot._telebot is not None
assert bot._user... | true | true |
f74cb54d57dbe6c6d765653d26b2f758001ddc30 | 61 | py | Python | tests/test_nothing.py | jeffseif/queens | 00303ad9a58845162194b3e56d149f0e6a3818a5 | [
"BSD-3-Clause"
] | 1 | 2018-03-21T20:57:31.000Z | 2018-03-21T20:57:31.000Z | tests/test_nothing.py | jeffseif/queens | 00303ad9a58845162194b3e56d149f0e6a3818a5 | [
"BSD-3-Clause"
] | null | null | null | tests/test_nothing.py | jeffseif/queens | 00303ad9a58845162194b3e56d149f0e6a3818a5 | [
"BSD-3-Clause"
] | 1 | 2020-01-12T15:39:30.000Z | 2020-01-12T15:39:30.000Z | class TestNothing:
def test_nothing(self):
pass
| 12.2 | 27 | 0.639344 | class TestNothing:
def test_nothing(self):
pass
| true | true |
f74cb5b936671341239e74edfd672023ff23fd68 | 1,874 | py | Python | 03_spyder/proyecto_spyder.py | 2018-B-GR1-Python/Velasco-Yepez-Andres-David | 0c017d6e5f169f31207ddec5ceffc8dd82d327eb | [
"MIT"
] | null | null | null | 03_spyder/proyecto_spyder.py | 2018-B-GR1-Python/Velasco-Yepez-Andres-David | 0c017d6e5f169f31207ddec5ceffc8dd82d327eb | [
"MIT"
] | null | null | null | 03_spyder/proyecto_spyder.py | 2018-B-GR1-Python/Velasco-Yepez-Andres-David | 0c017d6e5f169f31207ddec5ceffc8dd82d327eb | [
"MIT"
] | 1 | 2019-10-21T19:27:12.000Z | 2019-10-21T19:27:12.000Z |
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 28 01:15:31 2018
@author: Andres
"""
import pandas as pd
url = 'http://catalogo.datosabiertos.gob.ec/api/action/datastore_search?resource_id=8513f446-1c94-426e-8592-d4cbdd295f33&limit=1000'
datos = pd.read_json(url, typ='frame')
datos =pd.DataFrame.from_dict(datos["res... | 34.703704 | 151 | 0.719851 |
import pandas as pd
url = 'http://catalogo.datosabiertos.gob.ec/api/action/datastore_search?resource_id=8513f446-1c94-426e-8592-d4cbdd295f33&limit=1000'
datos = pd.read_json(url, typ='frame')
datos =pd.DataFrame.from_dict(datos["result"]["records"]).set_index("_id")
datos.loc[289,'Canton']
class Homicidio:
de... | true | true |
f74cb5ccd0841f9ba4a42bf533afcd5c397029fb | 2,354 | py | Python | aliyun-python-sdk-vod/aliyunsdkvod/request/v20170321/AddWatermarkRequest.py | sdk-team/aliyun-openapi-python-sdk | 384730d707e6720d1676ccb8f552e6a7b330ec86 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-vod/aliyunsdkvod/request/v20170321/AddWatermarkRequest.py | sdk-team/aliyun-openapi-python-sdk | 384730d707e6720d1676ccb8f552e6a7b330ec86 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-vod/aliyunsdkvod/request/v20170321/AddWatermarkRequest.py | sdk-team/aliyun-openapi-python-sdk | 384730d707e6720d1676ccb8f552e6a7b330ec86 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 31.810811 | 71 | 0.757859 |
from aliyunsdkcore.request import RpcRequest
class AddWatermarkRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'vod', '2017-03-21', 'AddWatermark','vod')
self.set_method('POST')
def get_ResourceOwnerId(self):
return self.get_query_params().get('ResourceOwnerId')
... | true | true |
f74cb6af5daaf14018ac23e5594263d6b8ccb6d3 | 5,537 | py | Python | flare/safeeval.py | co-dev10/flare | b3b5686fe695097206c9fad17f461f5c9fef5c21 | [
"MIT"
] | null | null | null | flare/safeeval.py | co-dev10/flare | b3b5686fe695097206c9fad17f461f5c9fef5c21 | [
"MIT"
] | null | null | null | flare/safeeval.py | co-dev10/flare | b3b5686fe695097206c9fad17f461f5c9fef5c21 | [
"MIT"
] | null | null | null | """Here we are trying to provide an secure and safe space for evaluate simple python expressions
on some 'data'.
If you only need a oneshot evaluation, you call safeEval and enjoy the result. Otherwise call first compile to get the ast
representation and execute that compiled expression multiple times with different da... | 33.557576 | 122 | 0.686473 |
import ast
import typing
from typing import Any, Callable, Dict
class SafeEval:
def __init__(self, allowedCallables: typing.Union[None, typing.Dict[str, typing.Any]] = None):
if allowedCallables is not None:
self.allowedCallables = allowedCallables
else:
self.allowedCallables = dict()
self.nodes: Dic... | true | true |
f74cb6cbb3536439c60254ebefb1a6630d69115b | 4,832 | py | Python | lavalle_rrts.py | leonidk/cupdice | f3386337922337eaaae2f244607f1af73516843f | [
"MIT"
] | null | null | null | lavalle_rrts.py | leonidk/cupdice | f3386337922337eaaae2f244607f1af73516843f | [
"MIT"
] | null | null | null | lavalle_rrts.py | leonidk/cupdice | f3386337922337eaaae2f244607f1af73516843f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# rrt.py
# This program generates a simple rapidly
# exploring random tree (RRT) in a rectangular region.
#
# Written by Steve LaValle
# May 2011
import sys, random, math, pygame
from pygame.locals import *
from math import sqrt,cos,sin,atan2
import heapq
import numpy as np
#constants
XDIM = 50... | 34.514286 | 117 | 0.515108 |
import sys, random, math, pygame
from pygame.locals import *
from math import sqrt,cos,sin,atan2
import heapq
import numpy as np
XDIM = 500
YDIM = 500
WINSIZE = np.array([XDIM, YDIM])
MAX_STEP_SIZE = 12
NUMNODES = 5000
NUM_OBSTACLES = 30
OBSTACLE_WIDTH = 80
OBSTACLE_HEIGHT = 80
RAND_SEARCH_PROB = 0.25
GOAL_T... | true | true |
f74cb6e72162a0cee54f7de025b38f3510fe8b26 | 3,875 | py | Python | rovers/fastdownward/experiments/issue750/relativescatter.py | mehrdadzakershahrak/Online-Explanation-Generation | e41ad9b5a390abdaf271562a56105c191e33b74d | [
"MIT"
] | 1 | 2021-09-09T13:03:02.000Z | 2021-09-09T13:03:02.000Z | rovers/fastdownward/experiments/issue750/relativescatter.py | mehrdadzakershahrak/Online-Explanation-Generation | e41ad9b5a390abdaf271562a56105c191e33b74d | [
"MIT"
] | null | null | null | rovers/fastdownward/experiments/issue750/relativescatter.py | mehrdadzakershahrak/Online-Explanation-Generation | e41ad9b5a390abdaf271562a56105c191e33b74d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from collections import defaultdict
from matplotlib import ticker
from downward.reports.scatter import ScatterPlotReport
from downward.reports.plot import PlotReport, Matplotlib, MatplotlibPlot
# TODO: handle outliers
# TODO: this is mostly copied from ScatterMatplotlib (scatter.py)
class ... | 36.556604 | 78 | 0.615484 |
from collections import defaultdict
from matplotlib import ticker
from downward.reports.scatter import ScatterPlotReport
from downward.reports.plot import PlotReport, Matplotlib, MatplotlibPlot
class RelativeScatterMatplotlib(Matplotlib):
@classmethod
def _plot(cls, report, axes, categories, styles):
... | true | true |
f74cb738076efe04218c0c345593ee0824d87e17 | 3,724 | py | Python | azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_security_group_py3.py | Christina-Kang/azure-sdk-for-python | bbf982eb06aab04b8151f69f1d230b7f5fb96ebf | [
"MIT"
] | 1 | 2022-03-30T22:39:15.000Z | 2022-03-30T22:39:15.000Z | azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_security_group_py3.py | Christina-Kang/azure-sdk-for-python | bbf982eb06aab04b8151f69f1d230b7f5fb96ebf | [
"MIT"
] | 54 | 2016-03-25T17:25:01.000Z | 2018-10-22T17:27:54.000Z | azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_security_group_py3.py | Christina-Kang/azure-sdk-for-python | bbf982eb06aab04b8151f69f1d230b7f5fb96ebf | [
"MIT"
] | 2 | 2017-01-20T18:25:46.000Z | 2017-05-12T21:31:47.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 42.804598 | 210 | 0.642589 |
from .resource import Resource
class NetworkSecurityGroup(Resource):
_validation = {
'name': {'readonly': True},
'type': {'readonly': True},
'network_interfaces': {'readonly': True},
'subnets': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id'... | true | true |
f74cb8a159bb035c1daa1c36b3420e16710aa61f | 7,325 | py | Python | pbcommand/testkit/core.py | mpkocher/pbcommand | 78514aba81d131569e97ae339eab5271502cf4b7 | [
"BSD-3-Clause-Clear"
] | 1 | 2021-05-21T11:28:59.000Z | 2021-05-21T11:28:59.000Z | pbcommand/testkit/core.py | mpkocher/pbcommand | 78514aba81d131569e97ae339eab5271502cf4b7 | [
"BSD-3-Clause-Clear"
] | null | null | null | pbcommand/testkit/core.py | mpkocher/pbcommand | 78514aba81d131569e97ae339eab5271502cf4b7 | [
"BSD-3-Clause-Clear"
] | null | null | null |
import os
import unittest
import logging
import tempfile
import subprocess
from .base_utils import (HAS_PBCORE,
pbcore_skip_msg,
get_temp_file,
get_temp_dir)
from pbcommand.resolver import (resolve_tool_contract,
... | 41.151685 | 178 | 0.67413 |
import os
import unittest
import logging
import tempfile
import subprocess
from .base_utils import (HAS_PBCORE,
pbcore_skip_msg,
get_temp_file,
get_temp_dir)
from pbcommand.resolver import (resolve_tool_contract,
... | true | true |
f74cb946471c68dba8a7f1e08dd6d84908ab7e3d | 253 | py | Python | __init__.py | OptimalBPM/optimalbpm | 4c65cd43a36e3318a49de7cd598069ea0623dc69 | [
"RSA-MD"
] | 2 | 2016-05-02T14:16:07.000Z | 2020-06-25T19:24:29.000Z | __init__.py | OptimalBPM/optimalbpm | 4c65cd43a36e3318a49de7cd598069ea0623dc69 | [
"RSA-MD"
] | null | null | null | __init__.py | OptimalBPM/optimalbpm | 4c65cd43a36e3318a49de7cd598069ea0623dc69 | [
"RSA-MD"
] | 1 | 2020-06-25T19:24:31.000Z | 2020-06-25T19:24:31.000Z | """
This package holds the Optimal BPM plugin, its libraries and UI
The Optimal Framework loads this that
"""
import runpy
__author__ = 'Nicklas Borjesson'
def run_agent():
runpy.run_module(mod_name="optimalbpm.agent.agent", run_name="__main__")
| 21.083333 | 76 | 0.758893 | import runpy
__author__ = 'Nicklas Borjesson'
def run_agent():
runpy.run_module(mod_name="optimalbpm.agent.agent", run_name="__main__")
| true | true |
f74cb9b008cb38b7c53445eeb2bde7398928035d | 2,653 | py | Python | test/python/quantum_info/test_weyl.py | lerongil/qiskit-terra | a25af2a2378bc3d4f5ec73b948d048d1b707454c | [
"Apache-2.0"
] | 3 | 2019-11-20T08:15:28.000Z | 2020-11-01T15:32:57.000Z | test/python/quantum_info/test_weyl.py | lerongil/qiskit-terra | a25af2a2378bc3d4f5ec73b948d048d1b707454c | [
"Apache-2.0"
] | 4 | 2019-05-13T15:28:46.000Z | 2019-12-19T20:47:02.000Z | test/python/quantum_info/test_weyl.py | lerongil/qiskit-terra | a25af2a2378bc3d4f5ec73b948d048d1b707454c | [
"Apache-2.0"
] | 1 | 2021-07-07T16:55:41.000Z | 2021-07-07T16:55:41.000Z | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... | 33.582278 | 87 | 0.572936 |
import unittest
import numpy as np
from numpy.testing import assert_allclose
from qiskit.test import QiskitTestCase
from qiskit.quantum_info.random import random_unitary
from qiskit.quantum_info.synthesis.weyl import weyl_coordinates
from qiskit.quantum_info.synthesis.local_invariance import (two_qubit... | true | true |
f74cbb29f76b92c1498f4f7b05fb217cf3c0f680 | 433 | py | Python | octosql_py/core/octosql.py | styczynski/octosql.py | 2180f28d7e8bf11ca09244b730dbf0bac9751649 | [
"MIT"
] | 2 | 2019-10-27T17:54:21.000Z | 2019-10-27T22:42:55.000Z | octosql_py/core/octosql.py | styczynski/octosql.py | 2180f28d7e8bf11ca09244b730dbf0bac9751649 | [
"MIT"
] | 1 | 2021-08-16T00:40:18.000Z | 2021-08-16T00:40:18.000Z | octosql_py/core/octosql.py | styczynski/octosql.py | 2180f28d7e8bf11ca09244b730dbf0bac9751649 | [
"MIT"
] | null | null | null | import octosql_py_native
import yaml
from .connection import OctoSQLConnection
class OctoSQL:
def __init__(self):
octosql_py_native.init()
def connect(self, sources):
conf = {
"dataSources": list(map(lambda source: source.generateConfigObject(), sources))
}
config... | 25.470588 | 91 | 0.674365 | import octosql_py_native
import yaml
from .connection import OctoSQLConnection
class OctoSQL:
def __init__(self):
octosql_py_native.init()
def connect(self, sources):
conf = {
"dataSources": list(map(lambda source: source.generateConfigObject(), sources))
}
config... | true | true |
f74cbcb298de75b693ac16556dafbeaab48a008f | 206 | py | Python | python/olm/__init__.py | kiwiirc/olm | beaa6216ad5c6483f32f5e0b6384c6e0b682a8bc | [
"Apache-2.0"
] | 1 | 2021-12-04T21:07:20.000Z | 2021-12-04T21:07:20.000Z | python/olm/__init__.py | kiwiirc/olm | beaa6216ad5c6483f32f5e0b6384c6e0b682a8bc | [
"Apache-2.0"
] | null | null | null | python/olm/__init__.py | kiwiirc/olm | beaa6216ad5c6483f32f5e0b6384c6e0b682a8bc | [
"Apache-2.0"
] | 1 | 2021-12-04T21:07:09.000Z | 2021-12-04T21:07:09.000Z | from .account import Account
from .session import Session
from .outbound_group_session import OutboundGroupSession
from .inbound_group_session import InboundGroupSession
from .utility import ed25519_verify
| 34.333333 | 56 | 0.878641 | from .account import Account
from .session import Session
from .outbound_group_session import OutboundGroupSession
from .inbound_group_session import InboundGroupSession
from .utility import ed25519_verify
| true | true |
f74cbd1f6e22f2005186520584170a9e565c6dca | 13,176 | py | Python | tests/test_views.py | iandroogmans/django-reports | 2663abfa0546df6e12af651ea959b395eb4c764b | [
"BSD-3-Clause"
] | 1 | 2020-06-11T12:38:21.000Z | 2020-06-11T12:38:21.000Z | tests/test_views.py | iandroogmans/django-reports | 2663abfa0546df6e12af651ea959b395eb4c764b | [
"BSD-3-Clause"
] | 3 | 2020-06-05T18:31:28.000Z | 2021-06-10T20:29:29.000Z | tests/test_views.py | iandroogmans/django-reports | 2663abfa0546df6e12af651ea959b395eb4c764b | [
"BSD-3-Clause"
] | 1 | 2020-01-22T09:16:41.000Z | 2020-01-22T09:16:41.000Z | import json
from django import forms
from django.contrib.auth.models import User
from django.http.response import HttpResponse
from django.test import TestCase
from django.test import client
from django.test.client import RequestFactory
from django.test.utils import override_settings
import six
import advanced_reports
... | 46.231579 | 120 | 0.577869 | import json
from django import forms
from django.contrib.auth.models import User
from django.http.response import HttpResponse
from django.test import TestCase
from django.test import client
from django.test.client import RequestFactory
from django.test.utils import override_settings
import six
import advanced_reports
... | true | true |
f74cbef832cc82da64d8b458393871641132b1af | 12,926 | py | Python | src/syntaxerrors/pytokenizer.py | cfbolz/syntaxerrors | 1c7ecc8fd0d05253d5c55dee39802cfb86fb69f7 | [
"Apache-2.0",
"OpenSSL"
] | 5 | 2018-04-11T15:19:53.000Z | 2020-10-27T15:23:18.000Z | src/syntaxerrors/pytokenizer.py | cfbolz/syntaxerrors | 1c7ecc8fd0d05253d5c55dee39802cfb86fb69f7 | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | src/syntaxerrors/pytokenizer.py | cfbolz/syntaxerrors | 1c7ecc8fd0d05253d5c55dee39802cfb86fb69f7 | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | import six
from syntaxerrors import automata
from syntaxerrors.parser import Token
from syntaxerrors.pytoken import python_opmap_bytes
from syntaxerrors.pytoken import tokens
from syntaxerrors.error import TokenError, TokenIndentationError
from syntaxerrors.pytokenize import tabsize, whiteSpaceDFA, \
triple_quoted... | 42.24183 | 104 | 0.51439 | import six
from syntaxerrors import automata
from syntaxerrors.parser import Token
from syntaxerrors.pytoken import python_opmap_bytes
from syntaxerrors.pytoken import tokens
from syntaxerrors.error import TokenError, TokenIndentationError
from syntaxerrors.pytokenize import tabsize, whiteSpaceDFA, \
triple_quoted... | true | true |
f74cbf5646f3fdc12a5b3867ebd0fbd9aac312c7 | 561 | py | Python | svaudio/repo/schema.py | metrasynth/svaudio | eb9547002159305f63c7f5a885b9a9b4025d14bf | [
"MIT"
] | 1 | 2021-06-04T07:48:37.000Z | 2021-06-04T07:48:37.000Z | svaudio/repo/schema.py | metrasynth/svaudio | eb9547002159305f63c7f5a885b9a9b4025d14bf | [
"MIT"
] | 35 | 2021-04-06T07:54:00.000Z | 2022-03-31T08:11:49.000Z | svaudio/repo/schema.py | metrasynth/svaudio | eb9547002159305f63c7f5a885b9a9b4025d14bf | [
"MIT"
] | 1 | 2021-06-30T01:28:28.000Z | 2021-06-30T01:28:28.000Z | from graphene import ObjectType, relay
from graphene_django import DjangoObjectType
from graphene_django.filter import DjangoFilterConnectionField
from . import models as m
class FileNode(DjangoObjectType):
class Meta:
model = m.File
interfaces = (relay.Node,)
filter_fields = [
... | 23.375 | 62 | 0.647059 | from graphene import ObjectType, relay
from graphene_django import DjangoObjectType
from graphene_django.filter import DjangoFilterConnectionField
from . import models as m
class FileNode(DjangoObjectType):
class Meta:
model = m.File
interfaces = (relay.Node,)
filter_fields = [
... | true | true |
f74cc0684c115b2374a4cb8c88040b864ba6430a | 1,227 | py | Python | community/forms.py | PickBas/meta-social | f6fb0a50c30e240086a75917b705dfdc71dbebf9 | [
"MIT"
] | null | null | null | community/forms.py | PickBas/meta-social | f6fb0a50c30e240086a75917b705dfdc71dbebf9 | [
"MIT"
] | 15 | 2020-06-07T07:58:05.000Z | 2022-01-19T16:53:47.000Z | community/forms.py | PickBas/meta-social | f6fb0a50c30e240086a75917b705dfdc71dbebf9 | [
"MIT"
] | null | null | null | """
Meta social community forms
"""
from django import forms
from .models import Community
class EditCommunityForm(forms.ModelForm):
"""
Community editing form
"""
def __init__(self, *args, **kwargs):
super(EditCommunityForm, self).__init__(*args, **kwargs)
for key in self.fields:
... | 21.910714 | 65 | 0.577832 |
from django import forms
from .models import Community
class EditCommunityForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(EditCommunityForm, self).__init__(*args, **kwargs)
for key in self.fields:
self.fields[key].required = True
class Meta:
model = Co... | true | true |
f74cc0d67abe6425dba4632512a1fe1e7686a1f8 | 723 | py | Python | migrations/versions/276ef161b610_.py | Jc2k/microauth | ff7c9a1aa493fe50f7f59f618f3317910551b99d | [
"Apache-2.0"
] | 2 | 2018-06-07T18:39:37.000Z | 2020-05-16T11:08:29.000Z | migrations/versions/276ef161b610_.py | Jc2k/microauth | ff7c9a1aa493fe50f7f59f618f3317910551b99d | [
"Apache-2.0"
] | 2 | 2017-11-19T16:52:01.000Z | 2018-08-11T10:49:08.000Z | migrations/versions/276ef161b610_.py | Jc2k/microauth | ff7c9a1aa493fe50f7f59f618f3317910551b99d | [
"Apache-2.0"
] | 1 | 2018-05-26T06:03:04.000Z | 2018-05-26T06:03:04.000Z | """empty message
Revision ID: 276ef161b610
Revises:
Create Date: 2017-10-24 19:30:22.200973
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '276ef161b610'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto gene... | 21.909091 | 65 | 0.673582 | from alembic import op
import sqlalchemy as sa
revision = '276ef161b610'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
)
| true | true |
f74cc32285ed57569ca4e11695799a5e6ec6a355 | 385 | py | Python | djconnectwise/migrations/0061_auto_20180605_1208.py | kti-sam/django-connectwise | 28484faad9435892a46b8ce4a3c957f64c299971 | [
"MIT"
] | 10 | 2017-04-27T19:51:38.000Z | 2020-10-09T17:21:23.000Z | djconnectwise/migrations/0061_auto_20180605_1208.py | kti-sam/django-connectwise | 28484faad9435892a46b8ce4a3c957f64c299971 | [
"MIT"
] | 45 | 2017-02-07T22:52:07.000Z | 2021-11-25T21:45:44.000Z | djconnectwise/migrations/0061_auto_20180605_1208.py | kti-sam/django-connectwise | 28484faad9435892a46b8ce4a3c957f64c299971 | [
"MIT"
] | 9 | 2017-01-27T00:07:33.000Z | 2021-07-12T19:48:27.000Z | # Generated by Django 2.0 on 2018-06-05 12:08
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('djconnectwise', '0060_auto_20180605_0840'),
]
operations = [
migrations.AlterModelOptions(
name='team',
options={'ordering': (... | 21.388889 | 81 | 0.602597 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('djconnectwise', '0060_auto_20180605_0840'),
]
operations = [
migrations.AlterModelOptions(
name='team',
options={'ordering': ('name', 'id'), 'verbose_name_plural': 'Teams'... | true | true |
f74cc3a80448c1bb51a9d66f2d6dd790533eb4cf | 989 | py | Python | api/app/schemas/theq/permission_schema.py | saravanpa-aot/queue-management | 02264c0c02626ef0da4b1f8ad41375b296f42d06 | [
"Apache-2.0"
] | 1 | 2020-09-08T21:49:04.000Z | 2020-09-08T21:49:04.000Z | api/app/schemas/theq/permission_schema.py | ChrisDMac/queue-management | 3d9b83c82e07d538214c2bbeac037dbec5567588 | [
"Apache-2.0"
] | 3 | 2020-10-21T15:44:41.000Z | 2020-12-03T17:49:47.000Z | api/app/schemas/theq/permission_schema.py | acoard-aot/queue-management | 07023246b2adee315d9e954a82c6f0891017e2da | [
"Apache-2.0"
] | null | null | null | '''Copyright 2018 Province of British Columbia
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 agreed to in writing,... | 30.90625 | 72 | 0.764408 |
import toastedmarshmallow
from marshmallow import fields
from app.models.theq import Permission
from qsystem import ma
class PermissionSchema(ma.SQLAlchemySchema):
class Meta:
model = Permission
include_relationships = True
load_instance = True
jit = toastedmarshmallow.Jit
p... | true | true |
f74cc3dae53a873591df0a5f8f676fd93a75865f | 26,385 | py | Python | c7n/filters/core.py | nebed/cloud-custodian | ac3feeedb85458bb11836ed01e18289983ea00fb | [
"Apache-2.0"
] | 1 | 2020-04-22T02:30:14.000Z | 2020-04-22T02:30:14.000Z | c7n/filters/core.py | zavab/cloud-custodian | 63efdc1dc7938f29440b1635668a0fa074f86b67 | [
"Apache-2.0"
] | null | null | null | c7n/filters/core.py | zavab/cloud-custodian | 63efdc1dc7938f29440b1635668a0fa074f86b67 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015-2018 Capital One Services, LLC
#
# 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 agreed ... | 32.374233 | 100 | 0.586091 |
from __future__ import absolute_import, division, print_function, unicode_literals
import copy
import datetime
from datetime import timedelta
import fnmatch
import ipaddress
import logging
import operator
import re
import sys
import os
from dateutil.tz import tzutc
from dateutil.parser import parse
from ... | true | true |
f74cc54d1012bdc34fb68c3ec1453a8197f3385c | 7,791 | py | Python | docs/conf.py | bastih/banana | f9a4c784fb6eac1d7b247bb28b3a433517046511 | [
"MIT"
] | 3 | 2015-04-11T19:55:57.000Z | 2021-01-09T18:14:57.000Z | docs/conf.py | bastih/banana | f9a4c784fb6eac1d7b247bb28b3a433517046511 | [
"MIT"
] | null | null | null | docs/conf.py | bastih/banana | f9a4c784fb6eac1d7b247bb28b3a433517046511 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# FeinCMS documentation build configuration file, created by
# sphinx-quickstart on Mon Aug 10 17:03:33 2009.
#
# 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... | 36.069444 | 126 | 0.712874 |
import sys, os
extensions = ['sphinx.ext.autodoc']
templates_path = ['_templates']
source_suffix = '.txt'
source_encoding = 'utf-8'
master_doc = 'index'
project = u'Banana'
copyright = u'2009, Banana contributors'
# |version| and |release|, also used in various other places througho... | true | true |
f74cc5f2a65a80b8c188d0b2d860a923080ef38b | 1,126 | py | Python | tendytrader/numeric/get_finance.py | Volhacks-III-Supreme-Team/tendytrader | 9b91dc82f43bcc0a06d8ca6d66e4d465c78575e9 | [
"MIT"
] | null | null | null | tendytrader/numeric/get_finance.py | Volhacks-III-Supreme-Team/tendytrader | 9b91dc82f43bcc0a06d8ca6d66e4d465c78575e9 | [
"MIT"
] | 2 | 2018-09-30T04:44:34.000Z | 2018-10-03T17:51:08.000Z | tendytrader/numeric/get_finance.py | Volhacks-III-Supreme-Team/tendytrader | 9b91dc82f43bcc0a06d8ca6d66e4d465c78575e9 | [
"MIT"
] | null | null | null | import datetime
import resource
from pandas_datareader import data as pdr
import fix_yahoo_finance as yf
from tickers import test_tickers
def get_all_stock_data(start, end, threads=(int)(resource.RLIMIT_NPROC*0.25)):
assert isinstance(start, datetime.datetime), "Error: start time must be datetime object"
asse... | 40.214286 | 92 | 0.715808 | import datetime
import resource
from pandas_datareader import data as pdr
import fix_yahoo_finance as yf
from tickers import test_tickers
def get_all_stock_data(start, end, threads=(int)(resource.RLIMIT_NPROC*0.25)):
assert isinstance(start, datetime.datetime), "Error: start time must be datetime object"
asse... | true | true |
f74cc687ad0294c1cb478c36ec6caef291dee654 | 1,779 | py | Python | setup.py | Forward83/staff_info | 7ca2b4dd9abd50129252ae89d4c93fec73170c1f | [
"MIT"
] | null | null | null | setup.py | Forward83/staff_info | 7ca2b4dd9abd50129252ae89d4c93fec73170c1f | [
"MIT"
] | null | null | null | setup.py | Forward83/staff_info | 7ca2b4dd9abd50129252ae89d4c93fec73170c1f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = ['coverage==4.5.1', 'mock==2.0.0', 'my... | 32.345455 | 145 | 0.636875 |
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = ['coverage==4.5.1', 'mock==2.0.0', 'mysql-connector-python==8.0.11', 'nose==1.3.7', 'Pillow==5.1.0', ]
... | true | true |
f74cc6b168c480e45c22f76f0bd1d33292d022de | 3,079 | py | Python | test/functional/wallet_keypool.py | CircuitProject/Circuit-Project | a186619d15f1fed2870f2fe69d1302b9ab22c5bc | [
"MIT"
] | 2 | 2020-01-17T17:57:31.000Z | 2020-10-30T00:48:23.000Z | test/functional/wallet_keypool.py | CircuitProject/Circuit-Project | a186619d15f1fed2870f2fe69d1302b9ab22c5bc | [
"MIT"
] | null | null | null | test/functional/wallet_keypool.py | CircuitProject/Circuit-Project | a186619d15f1fed2870f2fe69d1302b9ab22c5bc | [
"MIT"
] | 2 | 2019-09-10T23:22:27.000Z | 2020-12-12T02:21:38.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-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 the wallet keypool and interaction with wallet encryption/locking."""
from test_framework.test_fr... | 38.012346 | 120 | 0.645664 |
from test_framework.test_framework import CircuitTestFramework
from test_framework.util import *
class KeyPoolTest(CircuitTestFramework):
def set_test_params(self):
self.num_nodes = 1
def run_test(self):
nodes = self.nodes
addr_before_encrypting = nodes[0].getnewaddress()
... | true | true |
f74cc7ad629bc36e54334b6fa6c15424df8cbc51 | 1,214 | py | Python | py/pyanaconda/tf_straightline.py | YodaEmbedding/experiments | 567c6a1c18fac2d951fe2af54aaa4917b7d529d2 | [
"MIT"
] | null | null | null | py/pyanaconda/tf_straightline.py | YodaEmbedding/experiments | 567c6a1c18fac2d951fe2af54aaa4917b7d529d2 | [
"MIT"
] | null | null | null | py/pyanaconda/tf_straightline.py | YodaEmbedding/experiments | 567c6a1c18fac2d951fe2af54aaa4917b7d529d2 | [
"MIT"
] | null | null | null | # Fit a straight line, of the form y=m*x+b
import tensorflow as tf
xs = [0.00, 1.00, 2.00, 3.00, 4.00, 5.00, 6.00, 7.00] # Features
ys = [-0.82, -0.94, -0.12, 0.26, 0.39, 0.64, 1.02, 1.00] # Labels
"""
with enough iterations, initial weights dont matter since our cost function is convex.
"""
m_initial = -0.5 # I... | 25.829787 | 108 | 0.660626 |
import tensorflow as tf
xs = [0.00, 1.00, 2.00, 3.00, 4.00, 5.00, 6.00, 7.00]
ys = [-0.82, -0.94, -0.12, 0.26, 0.39, 0.64, 1.02, 1.00]
m_initial = -0.5
b_initial = 1.0
m = tf.Variable(m_initial)
b = tf.Variable(b_initial)
error = 0.0
for i in range(len(xs)):
y_model = m * xs[i] + b
error += (
... | true | true |
f74cc803c10883f5f692aa626589bd70320d78f5 | 16,985 | py | Python | main.py | SupinePandora43/gmod-manager | 356abd7a4c6b4d284c8c34dee71d7e339bf76c81 | [
"MIT"
] | 1 | 2021-02-09T23:28:56.000Z | 2021-02-09T23:28:56.000Z | main.py | SupinePandora43/gmod-manager | 356abd7a4c6b4d284c8c34dee71d7e339bf76c81 | [
"MIT"
] | 1 | 2019-06-24T08:28:34.000Z | 2019-06-24T08:28:34.000Z | main.py | SupinePandora43/gmod-manager | 356abd7a4c6b4d284c8c34dee71d7e339bf76c81 | [
"MIT"
] | 3 | 2019-06-23T12:01:19.000Z | 2021-02-22T16:44:14.000Z | import requests
import os
import argparse
import json
import lzma
import subprocess
import shutil
import sys
from configparser import ConfigParser
parser = argparse.ArgumentParser(
description='Tool for managing Gmod Steam content')
parser.add_argument("-nogmad", help="for travis", action="store_true")
parser.add_... | 43 | 249 | 0.609243 | import requests
import os
import argparse
import json
import lzma
import subprocess
import shutil
import sys
from configparser import ConfigParser
parser = argparse.ArgumentParser(
description='Tool for managing Gmod Steam content')
parser.add_argument("-nogmad", help="for travis", action="store_true")
parser.add_... | true | true |
f74cc8c31c84f037431ee2757fcf70a43f0223e1 | 70,125 | py | Python | Lib/enum.py | emsoftware/cpython | 457ce60fc70f1c9290023f46fb82b6a490dff32e | [
"0BSD"
] | null | null | null | Lib/enum.py | emsoftware/cpython | 457ce60fc70f1c9290023f46fb82b6a490dff32e | [
"0BSD"
] | 5 | 2021-07-01T03:02:20.000Z | 2022-03-01T03:03:48.000Z | Lib/enum.py | emsoftware/cpython | 457ce60fc70f1c9290023f46fb82b6a490dff32e | [
"0BSD"
] | null | null | null | import sys
from types import MappingProxyType, DynamicClassAttribute
from builtins import property as _bltin_property, bin as _bltin_bin
__all__ = [
'EnumType', 'EnumMeta',
'Enum', 'IntEnum', 'StrEnum', 'Flag', 'IntFlag',
'auto', 'unique', 'property', 'verify',
'FlagBoundary', 'STRICT'... | 38.936702 | 109 | 0.54795 | import sys
from types import MappingProxyType, DynamicClassAttribute
from builtins import property as _bltin_property, bin as _bltin_bin
__all__ = [
'EnumType', 'EnumMeta',
'Enum', 'IntEnum', 'StrEnum', 'Flag', 'IntFlag',
'auto', 'unique', 'property', 'verify',
'FlagBoundary', 'STRICT'... | true | true |
f74cc9fb12670dbb8430188dec4e7bd6ba61d303 | 7,492 | py | Python | resources/gitfs.py | 26618929/saltshaker_api | 5ce1703b19f2339190ca5998cee5404716bcc177 | [
"MIT"
] | null | null | null | resources/gitfs.py | 26618929/saltshaker_api | 5ce1703b19f2339190ca5998cee5404716bcc177 | [
"MIT"
] | null | null | null | resources/gitfs.py | 26618929/saltshaker_api | 5ce1703b19f2339190ca5998cee5404716bcc177 | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
from flask_restful import Resource, reqparse, request
from fileserver.git_fs import gitlab_project
from common.const import role_dict
from common.log import loggers
from common.sso import access_required
from common.audit_log import audit_log
from flask import g
from resources.sls import delete_s... | 38.030457 | 91 | 0.473972 |
from flask_restful import Resource, reqparse, request
from fileserver.git_fs import gitlab_project
from common.const import role_dict
from common.log import loggers
from common.sso import access_required
from common.audit_log import audit_log
from flask import g
from resources.sls import delete_sls
import base64
logg... | true | true |
f74cca451636169176eeb02215d780a368a6fbb1 | 1,283 | py | Python | interface/Play.py | ShellyDong/AlphaGo | fbc14d5a832acab853cff24a708b411f5d2e2555 | [
"MIT"
] | 8 | 2016-07-12T08:35:39.000Z | 2022-03-15T09:28:02.000Z | interface/Play.py | lm18217762995/RocAlphaGo | 04bac9c9d16c16c3baf16988ac761903a687d4de | [
"MIT"
] | 3 | 2021-03-26T00:41:51.000Z | 2022-02-10T03:31:38.000Z | interface/Play.py | lm18217762995/RocAlphaGo | 04bac9c9d16c16c3baf16988ac761903a687d4de | [
"MIT"
] | 6 | 2017-05-24T05:29:45.000Z | 2022-02-27T15:00:20.000Z | """Interface for AlphaGo self-play"""
from AlphaGo.go import PASS, WHITE, GameState
class play_match(object):
"""Interface to handle play between two players."""
def __init__(self, player1, player2, save_dir=None, size=19):
# super(ClassName, self).__init__()
self.player1 = player1
se... | 35.638889 | 94 | 0.613406 | from AlphaGo.go import PASS, WHITE, GameState
class play_match(object):
def __init__(self, player1, player2, save_dir=None, size=19):
self.player1 = player1
self.player2 = player2
self.state = GameState(size=size)
def _play(self, player):
move = pla... | true | true |
f74ccacf380f5b6d0a1a6dbd76811db24dbbb597 | 9,074 | py | Python | cromwell_tools/cli.py | kgalens/cromwell-tools | 23c756a6c25c67ad4ccfacc6f8cf459bcacdac5f | [
"BSD-3-Clause"
] | null | null | null | cromwell_tools/cli.py | kgalens/cromwell-tools | 23c756a6c25c67ad4ccfacc6f8cf459bcacdac5f | [
"BSD-3-Clause"
] | null | null | null | cromwell_tools/cli.py | kgalens/cromwell-tools | 23c756a6c25c67ad4ccfacc6f8cf459bcacdac5f | [
"BSD-3-Clause"
] | null | null | null | import argparse
import requests
from cromwell_tools.cromwell_api import CromwellAPI
from cromwell_tools.cromwell_auth import CromwellAuth
from cromwell_tools.diag import task_runtime
from cromwell_tools import __version__
diagnostic_index = {
'task_runtime': task_runtime.run
}
def parser(arguments=None):
# ... | 31.075342 | 141 | 0.612409 | import argparse
import requests
from cromwell_tools.cromwell_api import CromwellAPI
from cromwell_tools.cromwell_auth import CromwellAuth
from cromwell_tools.diag import task_runtime
from cromwell_tools import __version__
diagnostic_index = {
'task_runtime': task_runtime.run
}
def parser(arguments=None):
... | true | true |
f74ccb72f30f7ea96cca83046165145b343d78e2 | 639 | py | Python | server/src/models/user.py | Theo-Cheynel/centrale | 65c0e2b12e3ea7f094badd4f2cfc601f7a1bf519 | [
"MIT"
] | null | null | null | server/src/models/user.py | Theo-Cheynel/centrale | 65c0e2b12e3ea7f094badd4f2cfc601f7a1bf519 | [
"MIT"
] | null | null | null | server/src/models/user.py | Theo-Cheynel/centrale | 65c0e2b12e3ea7f094badd4f2cfc601f7a1bf519 | [
"MIT"
] | null | null | null | """
Define the User model
"""
from . import db
from .abc import BaseModel, MetaBaseModel
class User(db.Model, BaseModel, metaclass=MetaBaseModel):
""" The User model """
__tablename__ = "user"
key = db.Column(db.Integer, primary_key=True)
first_name = db.Column(db.String(300), primary_key=False)
... | 27.782609 | 61 | 0.658842 | from . import db
from .abc import BaseModel, MetaBaseModel
class User(db.Model, BaseModel, metaclass=MetaBaseModel):
__tablename__ = "user"
key = db.Column(db.Integer, primary_key=True)
first_name = db.Column(db.String(300), primary_key=False)
last_name = db.Column(db.String(300), primary_key=False)
... | true | true |
f74ccb87c75fccea0fbedac4f6dbd0e2f081bb1e | 1,084 | py | Python | tools/infra/builder-cache-clobber.py | sarang-apps/darshan_browser | 173649bb8a7c656dc60784d19e7bb73e07c20daa | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | tools/infra/builder-cache-clobber.py | sarang-apps/darshan_browser | 173649bb8a7c656dc60784d19e7bb73e07c20daa | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | tools/infra/builder-cache-clobber.py | sarang-apps/darshan_browser | 173649bb8a7c656dc60784d19e7bb73e07c20daa | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2 | 2021-01-05T23:43:46.000Z | 2021-01-07T23:36:34.000Z | #!/usr/bin/env python
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Clobbers all builder caches for a specific builder.
Note that this currently does not support windows.
"""
import argparse
import ... | 27.794872 | 76 | 0.708487 |
import argparse
import hashlib
import sys
import clobber_cache_utils
def main(raw_args):
parser = argparse.ArgumentParser()
clobber_cache_utils.add_common_args(parser)
parser.add_argument('--builder', required=True)
parser.add_argument('--bucket', required=True)
parser.add_argument('--project', defau... | true | true |
f74ccbdb85394c4bc9f66312cdfb1114403351e8 | 11,462 | py | Python | dataset/generator.py | CDInstitute/CompoNET.github.io | f978f31a78628c70b1033ed02a75de8a50aa905d | [
"MIT"
] | null | null | null | dataset/generator.py | CDInstitute/CompoNET.github.io | f978f31a78628c70b1033ed02a75de8a50aa905d | [
"MIT"
] | null | null | null | dataset/generator.py | CDInstitute/CompoNET.github.io | f978f31a78628c70b1033ed02a75de8a50aa905d | [
"MIT"
] | null | null | null | import bpy, bmesh
from math import radians
import numpy as np
import os
import random
import sys
sys.path.append("D:\ProgramFiles\Anaconda\envs\py37\Lib\site-packages")
from pyntcloud import PyntCloud
file_dir = os.path.dirname(__file__)
sys.path.append(file_dir)
from blender_utils import extrude, gancio, get_min_m... | 29.314578 | 102 | 0.63776 | import bpy, bmesh
from math import radians
import numpy as np
import os
import random
import sys
sys.path.append("D:\ProgramFiles\Anaconda\envs\py37\Lib\site-packages")
from pyntcloud import PyntCloud
file_dir = os.path.dirname(__file__)
sys.path.append(file_dir)
from blender_utils import extrude, gancio, get_min_m... | true | true |
f74ccd2199549d30788c9b0bbb2b5de2f1e7514c | 2,935 | py | Python | bifrost/bifrost/stonne/ops/matmul.py | axelstjerngren/bifrost | 78f46d51b51b2ea6e4aa62336c052217700d7d35 | [
"MIT"
] | 1 | 2021-08-30T22:28:57.000Z | 2021-08-30T22:28:57.000Z | bifrost/bifrost/stonne/ops/matmul.py | axelstjerngren/bifrost | 78f46d51b51b2ea6e4aa62336c052217700d7d35 | [
"MIT"
] | null | null | null | bifrost/bifrost/stonne/ops/matmul.py | axelstjerngren/bifrost | 78f46d51b51b2ea6e4aa62336c052217700d7d35 | [
"MIT"
] | null | null | null | """
Register everything to do with matmul
"""
import tvm
from tvm import te, relay, autotvm
from tvm.topi import generic
import tvm.relay.op as _op
from tvm.relay.op.strategy.generic import *
import os
from ..simulator import architecture
from ..tiles import tiles
from tvm.auto_scheduler import is_auto_scheduler_enabl... | 33.352273 | 71 | 0.632368 | import tvm
from tvm import te, relay, autotvm
from tvm.topi import generic
import tvm.relay.op as _op
from tvm.relay.op.strategy.generic import *
import os
from ..simulator import architecture
from ..tiles import tiles
from tvm.auto_scheduler import is_auto_scheduler_enabled
from tvm.te import SpecializedCondition
@a... | true | true |
f74ccdda396e946d307802b276033960ac5bbf1d | 4,406 | py | Python | cunet/ftanet/network/ftanet.py | genisplaja/cunet | 58a200c84810f20099265e30200327eefddb3eff | [
"AFL-3.0"
] | null | null | null | cunet/ftanet/network/ftanet.py | genisplaja/cunet | 58a200c84810f20099265e30200327eefddb3eff | [
"AFL-3.0"
] | null | null | null | cunet/ftanet/network/ftanet.py | genisplaja/cunet | 58a200c84810f20099265e30200327eefddb3eff | [
"AFL-3.0"
] | null | null | null | import tensorflow as tf
from tensorflow.keras import backend as K
from tensorflow.keras import Input, Model
from tensorflow.keras.layers import Dense, Conv2D, BatchNormalization, Dropout, Lambda, \
GlobalAveragePooling2D, Activation, MaxPooling2D, AveragePooling2D, \
Concatenate, Add, Multiply, Softmax, Re... | 36.716667 | 90 | 0.568997 | import tensorflow as tf
from tensorflow.keras import backend as K
from tensorflow.keras import Input, Model
from tensorflow.keras.layers import Dense, Conv2D, BatchNormalization, Dropout, Lambda, \
GlobalAveragePooling2D, Activation, MaxPooling2D, AveragePooling2D, \
Concatenate, Add, Multiply, Softmax, Re... | true | true |
f74cce4f554dac06efdac24bf1049bc852f01ca9 | 531 | py | Python | plotly/validators/layout/scene/zaxis/_showtickprefix.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | 2 | 2020-03-24T11:41:14.000Z | 2021-01-14T07:59:43.000Z | plotly/validators/layout/scene/zaxis/_showtickprefix.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | null | null | null | plotly/validators/layout/scene/zaxis/_showtickprefix.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | 4 | 2019-06-03T14:49:12.000Z | 2022-01-06T01:05:12.000Z | import _plotly_utils.basevalidators
class ShowtickprefixValidator(
_plotly_utils.basevalidators.EnumeratedValidator
):
def __init__(
self,
plotly_name='showtickprefix',
parent_name='layout.scene.zaxis',
**kwargs
):
super(ShowtickprefixValidator, self).__init__(
... | 24.136364 | 54 | 0.591337 | import _plotly_utils.basevalidators
class ShowtickprefixValidator(
_plotly_utils.basevalidators.EnumeratedValidator
):
def __init__(
self,
plotly_name='showtickprefix',
parent_name='layout.scene.zaxis',
**kwargs
):
super(ShowtickprefixValidator, self).__init__(
... | true | true |
f74ccfcf45c03426fb4800307e49019a3f56450c | 22,845 | py | Python | code/descriptor_track/train_eval/make_n_perquery_df_gpu.py | seungkee/2nd-place-solution-to-facebook-image-similarity-matching-track | 716667bf416239f448e4ea2730a2cc5146536719 | [
"Apache-2.0"
] | 13 | 2021-12-07T17:15:10.000Z | 2022-02-23T08:45:58.000Z | code/descriptor_track/train_eval/make_n_perquery_df_gpu.py | seungkee/2nd-place-solution-to-facebook-image-similarity-matching-track | 716667bf416239f448e4ea2730a2cc5146536719 | [
"Apache-2.0"
] | 2 | 2021-12-16T14:33:10.000Z | 2021-12-28T07:15:33.000Z | code/descriptor_track/train_eval/make_n_perquery_df_gpu.py | seungkee/2nd-place-solution-to-facebook-image-similarity-matching-track | 716667bf416239f448e4ea2730a2cc5146536719 | [
"Apache-2.0"
] | 4 | 2021-12-08T07:52:28.000Z | 2022-03-29T05:50:38.000Z | import cv2
import os
import random
import time
import torch
import torch.backends.cudnn as cudnn
import models
from utils.logger import Logger
import myexman
from utils import utils
import sys
import torch.multiprocessing as mp
import torch.distributed as dist
import socket
from torchvision import transforms,datasets
f... | 40.505319 | 136 | 0.627052 | import cv2
import os
import random
import time
import torch
import torch.backends.cudnn as cudnn
import models
from utils.logger import Logger
import myexman
from utils import utils
import sys
import torch.multiprocessing as mp
import torch.distributed as dist
import socket
from torchvision import transforms,datasets
f... | true | true |
f74cd0578361714907ccc99e150e397680db4464 | 305 | py | Python | data/multilingual/Latn.INA/Serif_16/pdf_to_json_test_Latn.INA_Serif_16.py | antoinecarme/pdf_to_json_tests | d57a024fde862e698d916a1178f285883d7a3b2f | [
"BSD-3-Clause"
] | 1 | 2021-09-19T19:47:35.000Z | 2021-09-19T19:47:35.000Z | data/multilingual/Latn.INA/Serif_16/pdf_to_json_test_Latn.INA_Serif_16.py | antoinecarme/pdf_to_json_tests | d57a024fde862e698d916a1178f285883d7a3b2f | [
"BSD-3-Clause"
] | null | null | null | data/multilingual/Latn.INA/Serif_16/pdf_to_json_test_Latn.INA_Serif_16.py | antoinecarme/pdf_to_json_tests | d57a024fde862e698d916a1178f285883d7a3b2f | [
"BSD-3-Clause"
] | null | null | null | import pdf_to_json as p2j
import json
url = "file:data/multilingual/Latn.INA/Serif_16/udhr_Latn.INA_Serif_16.pdf"
lConverter = p2j.pdf_to_json.pdf_to_json_converter()
lConverter.mImageHashOnly = True
lDict = lConverter.convert(url)
print(json.dumps(lDict, indent=4, ensure_ascii=False, sort_keys=True))
| 30.5 | 75 | 0.813115 | import pdf_to_json as p2j
import json
url = "file:data/multilingual/Latn.INA/Serif_16/udhr_Latn.INA_Serif_16.pdf"
lConverter = p2j.pdf_to_json.pdf_to_json_converter()
lConverter.mImageHashOnly = True
lDict = lConverter.convert(url)
print(json.dumps(lDict, indent=4, ensure_ascii=False, sort_keys=True))
| true | true |
f74cd0641c138d39f75465ec762713bd231ca4a1 | 84,147 | py | Python | protos/gen/python/protos/public/monitoring/DataMonitoringService_pb2.py | benshaw/modeldb | 5ed5765a3d1842970489dee2fd8630848cbb3baa | [
"Apache-2.0"
] | 835 | 2017-02-08T20:14:24.000Z | 2020-03-12T17:37:49.000Z | protos/gen/python/protos/public/monitoring/DataMonitoringService_pb2.py | benshaw/modeldb | 5ed5765a3d1842970489dee2fd8630848cbb3baa | [
"Apache-2.0"
] | 651 | 2019-04-18T12:55:07.000Z | 2022-03-31T23:45:09.000Z | protos/gen/python/protos/public/monitoring/DataMonitoringService_pb2.py | benshaw/modeldb | 5ed5765a3d1842970489dee2fd8630848cbb3baa | [
"Apache-2.0"
] | 170 | 2017-02-13T14:49:22.000Z | 2020-02-19T17:59:12.000Z | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: monitoring/DataMonitoringService.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import sym... | 42.562974 | 9,204 | 0.773777 |
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db = _symbol_database.Default()
from ..uac import Collaborator_pb2 as uac_dot_Collabora... | true | true |
f74cd0c6d994ba5115d21b202a910ad5320985d7 | 3,400 | py | Python | docs/refer_project/wx/reply.py | xiaotianyi/INTELLI-City | ef6777b66350b3a3f6aac9c0441d67990ff23cd6 | [
"MIT"
] | null | null | null | docs/refer_project/wx/reply.py | xiaotianyi/INTELLI-City | ef6777b66350b3a3f6aac9c0441d67990ff23cd6 | [
"MIT"
] | null | null | null | docs/refer_project/wx/reply.py | xiaotianyi/INTELLI-City | ef6777b66350b3a3f6aac9c0441d67990ff23cd6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# filename: reply.py
import time
from wenpl.divide import showReply
class Msg(object):
def __init__(self):
pass
def send(self):
return "success"
class TextMsg(Msg):
def __init__(self, toUserName, fromUserName, content):
self.__dict = dict()
self._... | 32.692308 | 77 | 0.572353 |
import time
from wenpl.divide import showReply
class Msg(object):
def __init__(self):
pass
def send(self):
return "success"
class TextMsg(Msg):
def __init__(self, toUserName, fromUserName, content):
self.__dict = dict()
self.__dict['ToUserName'] = toUserName
se... | true | true |
f74cd279c5efd8eca846fcf2e6fe58c935265801 | 548 | py | Python | my_pic_hub/urls.py | asandelarvine/My_Pic_Hub | 3cf11c01485e5bee75b3b3937525cedc1d55d473 | [
"MIT"
] | null | null | null | my_pic_hub/urls.py | asandelarvine/My_Pic_Hub | 3cf11c01485e5bee75b3b3937525cedc1d55d473 | [
"MIT"
] | null | null | null | my_pic_hub/urls.py | asandelarvine/My_Pic_Hub | 3cf11c01485e5bee75b3b3937525cedc1d55d473 | [
"MIT"
] | null | null | null | from django.urls import re_path
from django.conf.urls.static import static
from django.conf import settings
from . import views
urlpatterns=[
re_path('^$',views.home,name = 'home'),
re_path(r'^all/',views.index, name= 'all'),
re_path(r'^categories/(\d+)',views.categories,name = 'categories'),
re_path(r... | 28.842105 | 81 | 0.677007 | from django.urls import re_path
from django.conf.urls.static import static
from django.conf import settings
from . import views
urlpatterns=[
re_path('^$',views.home,name = 'home'),
re_path(r'^all/',views.index, name= 'all'),
re_path(r'^categories/(\d+)',views.categories,name = 'categories'),
re_path(r... | true | true |
f74cd2b6d279cd7a3ab5a4b706476372a9799261 | 3,425 | py | Python | test/datasets/test_stsb.py | Nayef211/text | d963bdb82b4c6c5170430fd7289b9dd0a2b9283a | [
"BSD-3-Clause"
] | null | null | null | test/datasets/test_stsb.py | Nayef211/text | d963bdb82b4c6c5170430fd7289b9dd0a2b9283a | [
"BSD-3-Clause"
] | null | null | null | test/datasets/test_stsb.py | Nayef211/text | d963bdb82b4c6c5170430fd7289b9dd0a2b9283a | [
"BSD-3-Clause"
] | null | null | null | import os
import random
import tarfile
from collections import defaultdict
from unittest.mock import patch
from parameterized import parameterized
from torchtext.datasets.stsb import STSB
from ..common.case_utils import TempDirMixin, zip_equal, get_random_unicode
from ..common.torchtext_test_case import TorchtextTest... | 38.055556 | 122 | 0.648175 | import os
import random
import tarfile
from collections import defaultdict
from unittest.mock import patch
from parameterized import parameterized
from torchtext.datasets.stsb import STSB
from ..common.case_utils import TempDirMixin, zip_equal, get_random_unicode
from ..common.torchtext_test_case import TorchtextTest... | true | true |
f74cd37e12a0a297d462facbcfa4d1f162eda105 | 6,436 | py | Python | manila_tempest_tests/tests/api/admin/test_share_manage.py | sapcc/manila-tempest-plugin | 0ac95412b1b0555775b4d45f51c27af2fa84724a | [
"Apache-2.0"
] | null | null | null | manila_tempest_tests/tests/api/admin/test_share_manage.py | sapcc/manila-tempest-plugin | 0ac95412b1b0555775b4d45f51c27af2fa84724a | [
"Apache-2.0"
] | null | null | null | manila_tempest_tests/tests/api/admin/test_share_manage.py | sapcc/manila-tempest-plugin | 0ac95412b1b0555775b4d45f51c27af2fa84724a | [
"Apache-2.0"
] | 1 | 2021-12-22T13:14:59.000Z | 2021-12-22T13:14:59.000Z | # Copyright 2015 Mirantis 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... | 35.755556 | 79 | 0.662834 |
import ddt
from tempest import config
from tempest.lib.common.utils import data_utils
import testtools
from testtools import testcase as tc
from manila_tempest_tests.common import constants
from manila_tempest_tests.tests.api import base
from manila_tempest_tests import utils
CONF = config.CONF
@ddt.... | true | true |
f74cd396dee81ff1a81777f41e2f3f723f0f51ae | 34,908 | py | Python | desktop/core/ext-py/Babel-2.5.1/tests/test_dates.py | kokosing/hue | 2307f5379a35aae9be871e836432e6f45138b3d9 | [
"Apache-2.0"
] | 5,079 | 2015-01-01T03:39:46.000Z | 2022-03-31T07:38:22.000Z | desktop/core/ext-py/Babel-2.5.1/tests/test_dates.py | zks888/hue | 93a8c370713e70b216c428caa2f75185ef809deb | [
"Apache-2.0"
] | 1,623 | 2015-01-01T08:06:24.000Z | 2022-03-30T19:48:52.000Z | desktop/core/ext-py/Babel-2.5.1/tests/test_dates.py | zks888/hue | 93a8c370713e70b216c428caa2f75185ef809deb | [
"Apache-2.0"
] | 2,033 | 2015-01-04T07:18:02.000Z | 2022-03-28T19:55:47.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2011 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://babel.edgewall.org/wiki/License.
#
# This software consists... | 44.412214 | 110 | 0.625788 |
import calendar
from datetime import date, datetime, time, timedelta
import unittest
import pytest
import pytz
from pytz import timezone
from babel import dates, Locale
from babel.dates import NO_INHERITANCE_MARKER
from babel.util import FixedOffsetTimezone
class DateTimeFormatTestCase(unittest.TestCas... | true | true |
f74cd39b6bed0e46a409609c267056a68bab0c05 | 397 | py | Python | locations/migrations/0002_locations_featured_image.py | mwororokevin/django-property-site | a477d80cbac04fde33920d9b5e5f9de783d55fbd | [
"MIT"
] | null | null | null | locations/migrations/0002_locations_featured_image.py | mwororokevin/django-property-site | a477d80cbac04fde33920d9b5e5f9de783d55fbd | [
"MIT"
] | null | null | null | locations/migrations/0002_locations_featured_image.py | mwororokevin/django-property-site | a477d80cbac04fde33920d9b5e5f9de783d55fbd | [
"MIT"
] | null | null | null | # Generated by Django 3.1.7 on 2021-04-01 09:02
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('locations', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='locations',
name='featured_image',
... | 20.894737 | 61 | 0.596977 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('locations', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='locations',
name='featured_image',
field=models.ImageField(null=True, up... | true | true |
f74cd3f8471ea9f00e46aed08ff3a976b7bc461d | 4,651 | py | Python | lib/sqlalchemy/engine/util.py | expobrain/sqlalchemy | 8370ac2bff7f2bb98673d5cc79af7a61632d8dde | [
"MIT"
] | null | null | null | lib/sqlalchemy/engine/util.py | expobrain/sqlalchemy | 8370ac2bff7f2bb98673d5cc79af7a61632d8dde | [
"MIT"
] | null | null | null | lib/sqlalchemy/engine/util.py | expobrain/sqlalchemy | 8370ac2bff7f2bb98673d5cc79af7a61632d8dde | [
"MIT"
] | null | null | null | # engine/util.py
# Copyright (C) 2005-2022 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
from .. import exc
from .. import util
try:
from sqlalchemy.cyextension.util im... | 34.708955 | 79 | 0.637282 |
from .. import exc
from .. import util
try:
from sqlalchemy.cyextension.util import _distill_params_20
from sqlalchemy.cyextension.util import _distill_raw_params
except ImportError:
from ._py_util import _distill_params_20
from ._py_util import _distill_raw_params
def connection_memoi... | true | true |
f74cd5e6a71b86c31fa3f0ebf1d3d367ad127dfc | 8,684 | py | Python | tests/records/test_geometry.py | prakritichauhan07/pyramid_oereb | 1d680e920222eff1c35ac309389d1353312bcc7d | [
"BSD-2-Clause"
] | null | null | null | tests/records/test_geometry.py | prakritichauhan07/pyramid_oereb | 1d680e920222eff1c35ac309389d1353312bcc7d | [
"BSD-2-Clause"
] | null | null | null | tests/records/test_geometry.py | prakritichauhan07/pyramid_oereb | 1d680e920222eff1c35ac309389d1353312bcc7d | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import datetime
import math
from pathlib import Path
from shapely.geometry import Polygon, MultiPolygon, LineString, Point, MultiPoint, MultiLineString, \
GeometryCollection
import shapely.wkt
import pytest
from pyramid_oereb.lib.records.geometry import GeometryRecord
from pyramid_oereb.... | 31.350181 | 104 | 0.494473 |
import datetime
import math
from pathlib import Path
from shapely.geometry import Polygon, MultiPolygon, LineString, Point, MultiPoint, MultiLineString, \
GeometryCollection
import shapely.wkt
import pytest
from pyramid_oereb.lib.records.geometry import GeometryRecord
from pyramid_oereb.lib.records.law_status ... | true | true |
f74cd5e956fd1402e5ed13d404ce3984df03bd21 | 1,520 | py | Python | jf/__main__.py | alhoo/jf | e469638c7f09db9cacf0409fe4576b8dc5c805db | [
"MIT"
] | 12 | 2018-02-11T05:00:48.000Z | 2022-02-15T22:39:28.000Z | jf/__main__.py | alhoo/jf | e469638c7f09db9cacf0409fe4576b8dc5c805db | [
"MIT"
] | 6 | 2018-02-11T06:51:04.000Z | 2020-10-03T15:04:22.000Z | jf/__main__.py | alhoo/jf | e469638c7f09db9cacf0409fe4576b8dc5c805db | [
"MIT"
] | null | null | null | import click
from .main import jf
@click.command()
@click.option("--processes", default=1, help="Number of processes to use.")
@click.option(
"--from_file",
"-f",
help="read transformation from file. This is also activated for query strings that ends with '.jf'",
is_flag=True,
)
@click.option("--impor... | 22.352941 | 104 | 0.603289 | import click
from .main import jf
@click.command()
@click.option("--processes", default=1, help="Number of processes to use.")
@click.option(
"--from_file",
"-f",
help="read transformation from file. This is also activated for query strings that ends with '.jf'",
is_flag=True,
)
@click.option("--impor... | true | true |
f74cd68f0d8130eebffc823fe7af4c86f8b3a0bc | 767 | py | Python | refactor/old/apitest/actions/unittest/unittest/attacks/__init__.py | luissaiz/apicheck | 316971450ad226247e64e7ba7c95511e38d420c9 | [
"Apache-2.0"
] | 2 | 2019-05-31T09:56:59.000Z | 2019-05-31T11:28:50.000Z | refactor/old/apitest/actions/unittest/unittest/attacks/__init__.py | harry1080/apicheck | d38bd40711102b6f8e542c1a59786c25a6dc11ef | [
"Apache-2.0"
] | null | null | null | refactor/old/apitest/actions/unittest/unittest/attacks/__init__.py | harry1080/apicheck | d38bd40711102b6f8e542c1a59786c25a6dc11ef | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 BBVA
#
# 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 agreed to in writing, softwar... | 33.347826 | 74 | 0.765319 |
from .xss import *
from .sqli import *
from .http_methods import http_method_builder
ATTACKS_TEST = dict(
xss=xss_builder,
sql_injection=sqli_builder,
http_methods=http_method_builder
)
| true | true |
f74cd944f5f7922afb8ff2841ffa7418f02b6e38 | 3,561 | py | Python | tools/festive_moogle/give_items.py | PaulAnthonyReitz/topaz | ffa3a785f86ffdb2f6a5baf9895b649e3e3de006 | [
"FTL"
] | 6 | 2021-06-01T04:17:10.000Z | 2021-06-01T04:32:21.000Z | tools/festive_moogle/give_items.py | PaulAnthonyReitz/topaz | ffa3a785f86ffdb2f6a5baf9895b649e3e3de006 | [
"FTL"
] | 5 | 2020-04-10T19:33:53.000Z | 2021-06-27T17:50:05.000Z | tools/festive_moogle/give_items.py | PaulAnthonyReitz/topaz | ffa3a785f86ffdb2f6a5baf9895b649e3e3de006 | [
"FTL"
] | 2 | 2020-04-11T16:56:14.000Z | 2021-06-26T12:21:12.000Z | #!/usr/bin/python3
import mysql.connector as mariadb
# Change with correct info ##
sqlusername = "topaz" #
sqlpassword = "password" #
sqldatabase = "tpzdb" #
#############################
def all_characters(cursor, cursor2):
print("Items Available:\
\n1) Nomad Cap\
\n2) Moogle Cap\
\n3... | 31.513274 | 124 | 0.595619 |
import mysql.connector as mariadb
lusername = "topaz"
sqlpassword = "password"
sqldatabase = "tpzdb"
int(charid[0])
print(nameid)
if prize == 1:
variable = "festiveMoogleNomadCap"
elif prize == 2:
variable = "festiveMoogleMoogleCap"
elif prize ... | true | true |
f74cda046e2be37e249992296263aa4ca453a42b | 1,437 | py | Python | JcampReader/fileParser.py | aubravo/Clasificacion-de-actividad-volcanica | 0f7be0d77509fa13948a0f714103ce6e6d8cb2ae | [
"MIT"
] | 1 | 2021-10-20T02:42:20.000Z | 2021-10-20T02:42:20.000Z | JcampReader/fileParser.py | aubravo/ActividadVolcanica | 0f7be0d77509fa13948a0f714103ce6e6d8cb2ae | [
"MIT"
] | null | null | null | JcampReader/fileParser.py | aubravo/ActividadVolcanica | 0f7be0d77509fa13948a0f714103ce6e6d8cb2ae | [
"MIT"
] | null | null | null | import ActividadVolcanica.JcampReader.fileHandler as handler
import numpy as np
def parser (filename):
ToParse = handler.read(filename)
ArgList = ToParse.split("##")
ArgList.remove("")
Parameters =dict()
for x in ArgList:
try:
y = x.split("=")
if y[0] != "XYDATA":
... | 31.23913 | 87 | 0.542797 | import ActividadVolcanica.JcampReader.fileHandler as handler
import numpy as np
def parser (filename):
ToParse = handler.read(filename)
ArgList = ToParse.split("##")
ArgList.remove("")
Parameters =dict()
for x in ArgList:
try:
y = x.split("=")
if y[0] != "XYDATA":
... | true | true |
f74cdb164dfaa601f37afe4b1d8f01973aa16c3e | 838 | py | Python | sagemcom_api/models.py | mochrefiecom/python-sagemcom-api | e9f60aecb412b3d890af3c97b56a82c3a609681e | [
"MIT"
] | null | null | null | sagemcom_api/models.py | mochrefiecom/python-sagemcom-api | e9f60aecb412b3d890af3c97b56a82c3a609681e | [
"MIT"
] | null | null | null | sagemcom_api/models.py | mochrefiecom/python-sagemcom-api | e9f60aecb412b3d890af3c97b56a82c3a609681e | [
"MIT"
] | null | null | null | from collections import namedtuple
from enum import Enum
class EncryptionMethod(Enum):
def __str__(self):
return str(self.value)
MD5 = 'md5'
SHA512 = 'sha512'
UNKNOWN = 'unknown'
DeviceInfo = namedtuple(
"DeviceInfo", [
"mac_address",
"serial_number",
"manufacturer... | 20.439024 | 34 | 0.552506 | from collections import namedtuple
from enum import Enum
class EncryptionMethod(Enum):
def __str__(self):
return str(self.value)
MD5 = 'md5'
SHA512 = 'sha512'
UNKNOWN = 'unknown'
DeviceInfo = namedtuple(
"DeviceInfo", [
"mac_address",
"serial_number",
"manufacturer... | true | true |
f74cdb2bc453e5b32e95688397812a0a3581a563 | 2,954 | py | Python | Flask/Lezione7/project/serate/models.py | nick87ds/MaterialeSerate | 51627e47ff1d3c3ecfc9ce6741c04b91b3295359 | [
"MIT"
] | 12 | 2021-12-12T22:19:52.000Z | 2022-03-18T11:45:17.000Z | Flask/Lezione7/project/serate/models.py | nick87ds/MaterialeSerate | 51627e47ff1d3c3ecfc9ce6741c04b91b3295359 | [
"MIT"
] | 1 | 2021-02-02T09:21:23.000Z | 2021-02-02T09:21:23.000Z | Flask/Lezione7/project/serate/models.py | nick87ds/MaterialeSerate | 51627e47ff1d3c3ecfc9ce6741c04b91b3295359 | [
"MIT"
] | 7 | 2021-02-01T22:09:14.000Z | 2021-06-22T08:30:16.000Z | from project import db
import datetime
from project.corsi.models import Corso
# Tabella di relazione 1 Corso : N Serate
class Serata(db.Model):
__tablename__ = "serata"
__table_args__ = (db.UniqueConstraint("id", "data", name="constraint_serata"),)
id = db.Column(db.Integer(), primary_key=True)
nom... | 44.089552 | 212 | 0.640826 | from project import db
import datetime
from project.corsi.models import Corso
class Serata(db.Model):
__tablename__ = "serata"
__table_args__ = (db.UniqueConstraint("id", "data", name="constraint_serata"),)
id = db.Column(db.Integer(), primary_key=True)
nome = db.Column(db.String(255), nullable=Fa... | true | true |
f74cdb4295364e1b489fc3da90ae0de3e65f08f9 | 4,324 | py | Python | gui/runtests.py | darrenbilby/grr | aa8628b15d197f8c4541d1d24b76715bdddcac44 | [
"Apache-2.0"
] | 1 | 2015-01-07T05:29:57.000Z | 2015-01-07T05:29:57.000Z | gui/runtests.py | darrenbilby/grr | aa8628b15d197f8c4541d1d24b76715bdddcac44 | [
"Apache-2.0"
] | null | null | null | gui/runtests.py | darrenbilby/grr | aa8628b15d197f8c4541d1d24b76715bdddcac44 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""This is a selenium test harness used interactively with Selenium IDE."""
import copy
import socket
import threading
from wsgiref import simple_server
import logging
# pylint: disable=g-bad-import-order
from grr.gui import django_lib
# pylint: enable=g-bad-import-order
from grr.lib import a... | 29.414966 | 76 | 0.693571 |
import copy
import socket
import threading
from wsgiref import simple_server
import logging
from grr.gui import django_lib
from grr.lib import access_control
from grr.lib import config_lib
from grr.lib import data_store
from grr.lib import flags
from grr.lib import ipshell
from grr.lib import registry
from grr.... | true | true |
f74cdb44c3da1e283bce00e24fab25b7cc9b2133 | 2,695 | py | Python | src/olympia/abuse/models.py | atiqueahmedziad/addons-server | 6e1cc00bf15d245fbcdddf618286bba943731e45 | [
"BSD-3-Clause"
] | 10 | 2018-08-16T04:55:06.000Z | 2022-01-08T16:09:39.000Z | src/olympia/abuse/models.py | atiqueahmedziad/addons-server | 6e1cc00bf15d245fbcdddf618286bba943731e45 | [
"BSD-3-Clause"
] | 171 | 2018-05-20T00:27:59.000Z | 2022-03-21T13:34:27.000Z | src/olympia/abuse/models.py | atiqueahmedziad/addons-server | 6e1cc00bf15d245fbcdddf618286bba943731e45 | [
"BSD-3-Clause"
] | 12 | 2018-08-01T16:46:09.000Z | 2022-01-08T16:09:46.000Z | from django.conf import settings
from django.db import models
from django.utils import translation
from olympia import amo
from olympia.addons.models import Addon
from olympia.amo.models import ModelBase
from olympia.amo.utils import send_mail
from olympia.users.models import UserProfile
class AbuseReport(ModelBase)... | 37.430556 | 78 | 0.653432 | from django.conf import settings
from django.db import models
from django.utils import translation
from olympia import amo
from olympia.addons.models import Addon
from olympia.amo.models import ModelBase
from olympia.amo.utils import send_mail
from olympia.users.models import UserProfile
class AbuseReport(ModelBase)... | true | true |
f74cdc0d2925d2b84bcc717691f59617031e4bb9 | 3,130 | py | Python | driver.py | kvosbur/scheduler | 2e6386dc9a62da8e441bd9beebf45ff6a3834793 | [
"MIT"
] | null | null | null | driver.py | kvosbur/scheduler | 2e6386dc9a62da8e441bd9beebf45ff6a3834793 | [
"MIT"
] | null | null | null | driver.py | kvosbur/scheduler | 2e6386dc9a62da8e441bd9beebf45ff6a3834793 | [
"MIT"
] | null | null | null | import streamlit as st
from _scheduler.work import Room, Staff, EType, RType
from _scheduler.manager import RoomManager
import graphviz as graphviz
import datetime as dt
from datetime import datetime, date, timedelta
import scheduler
def get_num_of_staff():
num_of_staff = st.text_input("How many staff do you want... | 30.686275 | 79 | 0.588498 | import streamlit as st
from _scheduler.work import Room, Staff, EType, RType
from _scheduler.manager import RoomManager
import graphviz as graphviz
import datetime as dt
from datetime import datetime, date, timedelta
import scheduler
def get_num_of_staff():
num_of_staff = st.text_input("How many staff do you want... | true | true |
f74cde0c06c31b6c133142c7ddaaea1874029aa3 | 45,062 | py | Python | tests/test_wltp_db.py | qinfeng2011/wltp | 317ad38fb96599a29d22e40f69b6aeb4d205611d | [
"Apache-2.0"
] | null | null | null | tests/test_wltp_db.py | qinfeng2011/wltp | 317ad38fb96599a29d22e40f69b6aeb4d205611d | [
"Apache-2.0"
] | null | null | null | tests/test_wltp_db.py | qinfeng2011/wltp | 317ad38fb96599a29d22e40f69b6aeb4d205611d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2013-2019 European Commission (JRC);
# Licensed under the EUPL (the 'Licence');
# You may not use this work except in compliance with the Licence.
# You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl
"""(DEPRECATED) Compares the results of... | 38.091293 | 129 | 0.545138 |
from collections import OrderedDict
import glob
import logging
import math
import os
import re
import unittest
from unittest.case import skipIf
from wltp import utils
from wltp.utils import memoize
import numpy as np
import numpy.testing as npt
import pandas as pd
from wltp.experiment import Experiment
from ... | true | true |
f74cdeaf0c39ddc04f1fd152b600c1715618ce39 | 1,580 | py | Python | app/user/serializers.py | madisonalgo/recipe-app-api | aa2a67671e8f8b57473e7d22b7c5bbeca624846c | [
"MIT"
] | null | null | null | app/user/serializers.py | madisonalgo/recipe-app-api | aa2a67671e8f8b57473e7d22b7c5bbeca624846c | [
"MIT"
] | null | null | null | app/user/serializers.py | madisonalgo/recipe-app-api | aa2a67671e8f8b57473e7d22b7c5bbeca624846c | [
"MIT"
] | null | null | null | from django.contrib.auth import get_user_model, authenticate
from django.utils.translation import ugettext_lazy as _
from rest_framework import serializers
from pprint import pprint
class UserSerializer(serializers.ModelSerializer):
"""serializer for the users object"""
class Meta:
mode... | 31.6 | 75 | 0.623418 | from django.contrib.auth import get_user_model, authenticate
from django.utils.translation import ugettext_lazy as _
from rest_framework import serializers
from pprint import pprint
class UserSerializer(serializers.ModelSerializer):
class Meta:
model = get_user_model()
fields = ('em... | true | true |
f74cdeb46a2ba18d64d1e12cfe85a2b8a9314823 | 1,304 | py | Python | backend/recommender/models.py | Johnson-olaolu/SDPR-Dashboard | 1be52ed460dde16eb07174a6afeaaede057e639a | [
"MIT"
] | null | null | null | backend/recommender/models.py | Johnson-olaolu/SDPR-Dashboard | 1be52ed460dde16eb07174a6afeaaede057e639a | [
"MIT"
] | 10 | 2022-03-04T09:05:18.000Z | 2022-03-04T09:52:32.000Z | backend/recommender/models.py | Johnson-olaolu/SDPR-Dashboard | 1be52ed460dde16eb07174a6afeaaede057e639a | [
"MIT"
] | null | null | null | from django.db import models
# Create your models here.
class StudentDataDropout(models.Model) :
studentID = models.CharField(max_length=100000)
Complete1 = models.IntegerField()
CompleteCIP1 = models.IntegerField()
CompleteDevEnglish = models.IntegerField()
CompleteDevMath = models.IntegerField(... | 48.296296 | 81 | 0.770706 | from django.db import models
class StudentDataDropout(models.Model) :
studentID = models.CharField(max_length=100000)
Complete1 = models.IntegerField()
CompleteCIP1 = models.IntegerField()
CompleteDevEnglish = models.IntegerField()
CompleteDevMath = models.IntegerField()
CumGPA = models.Deci... | true | true |
f74ce28ad93ab00fe96bb9586e4776bac1969044 | 3,236 | py | Python | profiles_project/settings.py | csourav08/profiles-rest-api | 5f7f465d37d72b1dff29ccac90d04f38103b0d86 | [
"MIT"
] | null | null | null | profiles_project/settings.py | csourav08/profiles-rest-api | 5f7f465d37d72b1dff29ccac90d04f38103b0d86 | [
"MIT"
] | null | null | null | profiles_project/settings.py | csourav08/profiles-rest-api | 5f7f465d37d72b1dff29ccac90d04f38103b0d86 | [
"MIT"
] | null | null | null | """
Django settings for profiles_project project.
Generated by 'django-admin startproject' using Django 2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
impor... | 25.68254 | 91 | 0.701792 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = '+iuqhe)tr3ia7m3t6csa76tiays__2zr$y=#roa)rhn0tzx4_9'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.content... | true | true |
f74ce2e0d09d8acdcf39726ff713f82becab6237 | 9,374 | py | Python | lib/galaxy/webapps/galaxy/api/__init__.py | muon-spectroscopy-computational-project/muon-galaxy | b9e43e76459adbeae6002a53d265b971d5b3c1e4 | [
"CC-BY-3.0"
] | 10 | 2016-05-04T22:03:18.000Z | 2019-05-28T23:34:06.000Z | lib/galaxy/webapps/galaxy/api/__init__.py | common-workflow-language/galaxy | fd644561a80c682d99105a45294c8938b05f2ef6 | [
"CC-BY-3.0"
] | 125 | 2015-10-19T20:20:33.000Z | 2021-11-11T17:04:38.000Z | lib/galaxy/webapps/galaxy/api/__init__.py | gregvonkuster/galaxy | a32068a0338e6d738b055d62ada6f4d4c13ca9e7 | [
"CC-BY-3.0"
] | 4 | 2015-02-17T18:18:35.000Z | 2016-07-25T10:35:23.000Z | """
This module *does not* contain API routes. It exclusively contains dependencies to be used in FastAPI routes
"""
import inspect
from typing import (
Any,
AsyncGenerator,
cast,
Optional,
Type,
TypeVar,
)
from fastapi import (
Cookie,
Form,
Header,
Query,
Response,
)
from ... | 31.142857 | 151 | 0.696821 | import inspect
from typing import (
Any,
AsyncGenerator,
cast,
Optional,
Type,
TypeVar,
)
from fastapi import (
Cookie,
Form,
Header,
Query,
Response,
)
from fastapi.params import Depends
from fastapi_utils.cbv import cbv
from fastapi_utils.inferring_router import InferringR... | true | true |
f74ce42a7499f56a6309385b1c17777a89a51950 | 2,862 | py | Python | rx/concurrency/mainloopscheduler/tkinterscheduler.py | daliclass/RxPY | d3ff1b72963fd08341807986d49480351015165e | [
"MIT"
] | null | null | null | rx/concurrency/mainloopscheduler/tkinterscheduler.py | daliclass/RxPY | d3ff1b72963fd08341807986d49480351015165e | [
"MIT"
] | null | null | null | rx/concurrency/mainloopscheduler/tkinterscheduler.py | daliclass/RxPY | d3ff1b72963fd08341807986d49480351015165e | [
"MIT"
] | null | null | null | from typing import Optional
from rx.core import typing
from rx.disposable import CompositeDisposable, Disposable, SingleAssignmentDisposable
from ..schedulerbase import SchedulerBase
class TkinterScheduler(SchedulerBase):
"""A scheduler that schedules work via the Tkinter main event loop.
http://infohost.n... | 33.670588 | 85 | 0.598183 | from typing import Optional
from rx.core import typing
from rx.disposable import CompositeDisposable, Disposable, SingleAssignmentDisposable
from ..schedulerbase import SchedulerBase
class TkinterScheduler(SchedulerBase):
def __init__(self, master) -> None:
super().__init__()
self.master = mast... | true | true |
f74ce538f98fd398a073d75f375d347499daf7de | 498 | py | Python | more/jinja2/tests/fixtures/override_template_inheritance.py | sgaist/more.jinja2 | 8f6fb3034b7f15a4d8de9f0891b06bff6859f9df | [
"BSD-3-Clause"
] | 4 | 2015-05-16T19:48:34.000Z | 2019-06-23T20:19:31.000Z | more/jinja2/tests/fixtures/override_template_inheritance.py | sgaist/more.jinja2 | 8f6fb3034b7f15a4d8de9f0891b06bff6859f9df | [
"BSD-3-Clause"
] | 10 | 2015-01-07T14:12:58.000Z | 2020-10-02T14:54:44.000Z | more/jinja2/tests/fixtures/override_template_inheritance.py | sgaist/more.jinja2 | 8f6fb3034b7f15a4d8de9f0891b06bff6859f9df | [
"BSD-3-Clause"
] | 5 | 2015-05-15T22:15:39.000Z | 2020-10-02T13:51:20.000Z | from more.jinja2 import Jinja2App
class App(Jinja2App):
pass
@App.path(path="persons/{name}")
class Person:
def __init__(self, name):
self.name = name
@App.template_directory()
def get_template_dir():
return "templates"
@App.html(model=Person, template="person_inherit.jinja2")
def person_def... | 16.064516 | 57 | 0.712851 | from more.jinja2 import Jinja2App
class App(Jinja2App):
pass
@App.path(path="persons/{name}")
class Person:
def __init__(self, name):
self.name = name
@App.template_directory()
def get_template_dir():
return "templates"
@App.html(model=Person, template="person_inherit.jinja2")
def person_def... | true | true |
f74ce673f2b8f7b94e2c688247021bc0c54e0234 | 7,230 | py | Python | photobooth.py | davea/photobooth | 80e967c459d6aa779f8e188cf07fcc5681d3a070 | [
"MIT"
] | null | null | null | photobooth.py | davea/photobooth | 80e967c459d6aa779f8e188cf07fcc5681d3a070 | [
"MIT"
] | null | null | null | photobooth.py | davea/photobooth | 80e967c459d6aa779f8e188cf07fcc5681d3a070 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
import time
import queue
import random
import logging
import tempfile
from glob import glob
from configparser import ConfigParser
from picamera import PiCamera, Color
from ft5406 import Touchscreen
from PIL import Image
from camera import Camera, CameraError, CameraNotConnectedError
f... | 34.593301 | 154 | 0.673859 |
import os
import time
import queue
import random
import logging
import tempfile
from glob import glob
from configparser import ConfigParser
from picamera import PiCamera, Color
from ft5406 import Touchscreen
from PIL import Image
from camera import Camera, CameraError, CameraNotConnectedError
from printer import Pri... | true | true |
f74ce6d6571b2b6595ba0ad41b51dad5e239ce44 | 1,319 | py | Python | GameLauncher.py | bfahm/BEKA-Engine | 3dc0438794c7be2820b461ad9b5b55db0ff782ca | [
"MIT"
] | null | null | null | GameLauncher.py | bfahm/BEKA-Engine | 3dc0438794c7be2820b461ad9b5b55db0ff782ca | [
"MIT"
] | null | null | null | GameLauncher.py | bfahm/BEKA-Engine | 3dc0438794c7be2820b461ad9b5b55db0ff782ca | [
"MIT"
] | null | null | null | # Replace "Keeper" with game file name. Ex: if your game file is called MyGame.Py, Write MyGame instead of Keeper
from \
Keeper \
import *
from OpenGL.GLUT import *
# Setup Variables
screenwidth = 800
screenheight = 800
gameTitle = b"BEKA Engine"
def Timer(v):
Update()
glutTimerFunc(... | 29.977273 | 118 | 0.639121 |
from \
Keeper \
import *
from OpenGL.GLUT import *
screenwidth = 800
screenheight = 800
gameTitle = b"BEKA Engine"
def Timer(v):
Update()
glutTimerFunc(time_interval, Timer, 1)
def main():
glutInit()
glutInitDisplayMode(GLUT_SINGLE | G... | true | true |
f74ce710c3d884f6eab4381a27a82b25b866c761 | 30,581 | py | Python | code/Alignment/FREAD/prosci/loops/fread.py | Eitan177/StructuralMapping | c20ce43de2698902d606b718c9a9fdf2296b0a52 | [
"MIT"
] | 9 | 2018-08-03T17:59:11.000Z | 2020-04-10T20:56:32.000Z | code/Alignment/FREAD/prosci/loops/fread.py | Eitan177/StructuralMapping | c20ce43de2698902d606b718c9a9fdf2296b0a52 | [
"MIT"
] | null | null | null | code/Alignment/FREAD/prosci/loops/fread.py | Eitan177/StructuralMapping | c20ce43de2698902d606b718c9a9fdf2296b0a52 | [
"MIT"
] | 3 | 2019-01-08T21:40:02.000Z | 2020-04-10T21:00:58.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
import sys
import os
import time
import itertools
from heapq import heappush, heappop
# Compatibility with Python < 2.6
#
try:
from heapq import heappushpop
except ImportError:
def heappushpop(heap, item):
heappush(heap, item)
return heappop(heap)
import n... | 36.105077 | 436 | 0.640757 |
import sys
import os
import time
import itertools
from heapq import heappush, heappop
try:
from heapq import heappushpop
except ImportError:
def heappushpop(heap, item):
heappush(heap, item)
return heappop(heap)
import numpy
from prosci.util.protein import Pdb, ResidueList, Protein
from prosci.uti... | true | true |
f74ce760f4d049e81e1870a6aa4290f68b713961 | 1,985 | py | Python | rich/_windows.py | cansarigol/rich | 11203b86cd228e86cb5bfcf30011908cb5cd5f5a | [
"MIT"
] | null | null | null | rich/_windows.py | cansarigol/rich | 11203b86cd228e86cb5bfcf30011908cb5cd5f5a | [
"MIT"
] | null | null | null | rich/_windows.py | cansarigol/rich | 11203b86cd228e86cb5bfcf30011908cb5cd5f5a | [
"MIT"
] | null | null | null | import sys
from dataclasses import dataclass
@dataclass
class WindowsConsoleFeatures:
"""Windows features available."""
vt: bool = False
"""The console supports VT codes."""
truecolor: bool = False
"""The console supports truecolor."""
try:
import ctypes
from ctypes import wintypes
... | 27.191781 | 85 | 0.683627 | import sys
from dataclasses import dataclass
@dataclass
class WindowsConsoleFeatures:
vt: bool = False
truecolor: bool = False
try:
import ctypes
from ctypes import wintypes
from ctypes import LibraryLoader
windll = LibraryLoader(ctypes.WinDLL)
except (AttributeError, ImportError, Value... | true | true |
f74ce77b652d983f46952ae4029e59ee6fe6780f | 9,725 | py | Python | example/reinforcement-learning/a3c/a3c.py | xudong-sun/mxnet | fe42d30d5885dd576cb871fd70594c53efce9b42 | [
"Apache-2.0"
] | 42 | 2019-07-11T18:23:52.000Z | 2021-09-14T08:21:09.000Z | example/reinforcement-learning/a3c/a3c.py | greenpea0104/incubator-mxnet | fc9e70bf2d349ad4c6cb65ff3f0958e23a7410bf | [
"Apache-2.0"
] | 23 | 2018-06-11T20:03:54.000Z | 2018-08-10T03:17:49.000Z | example/reinforcement-learning/a3c/a3c.py | greenpea0104/incubator-mxnet | fc9e70bf2d349ad4c6cb65ff3f0958e23a7410bf | [
"Apache-2.0"
] | 51 | 2019-07-12T05:10:25.000Z | 2021-07-28T16:19:06.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 39.056225 | 158 | 0.622005 |
from __future__ import print_function
import mxnet as mx
import numpy as np
import rl_data
import sym
import argparse
import logging
import os
import gym
from datetime import datetime
import time
import sys
try:
from importlib import reload
except ImportError:
pass
parser = argparse.ArgumentPa... | true | true |
f74ce868b402fb327a13bfa68040cf0b1ba0c85e | 7,544 | py | Python | generated-libraries/python/netapp/volume/volume_language_attributes.py | radekg/netapp-ontap-lib-get | 6445ebb071ec147ea82a486fbe9f094c56c5c40d | [
"MIT"
] | 2 | 2017-03-28T15:31:26.000Z | 2018-08-16T22:15:18.000Z | generated-libraries/python/netapp/volume/volume_language_attributes.py | radekg/netapp-ontap-lib-get | 6445ebb071ec147ea82a486fbe9f094c56c5c40d | [
"MIT"
] | null | null | null | generated-libraries/python/netapp/volume/volume_language_attributes.py | radekg/netapp-ontap-lib-get | 6445ebb071ec147ea82a486fbe9f094c56c5c40d | [
"MIT"
] | null | null | null | from netapp.netapp_object import NetAppObject
class VolumeLanguageAttributes(NetAppObject):
"""
Information about the volume language settings.
"""
_language_code = None
@property
def language_code(self):
"""
The volume's language code (e.g. 'en_US').
<p>
Vo... | 33.981982 | 100 | 0.579666 | from netapp.netapp_object import NetAppObject
class VolumeLanguageAttributes(NetAppObject):
_language_code = None
@property
def language_code(self):
return self._language_code
@language_code.setter
def language_code(self, val):
if val != None:
self.validate('languag... | true | true |
f74ceb42384a3b75df2b8387dbd2409b50b4e1f2 | 2,110 | py | Python | pyutilities/serve/standalone.py | intelzhangw2/Converter-for-OPCUA | 70860637798ca94224aec3663d3ea3674a963c5a | [
"Apache-2.0"
] | 64 | 2018-08-30T05:18:54.000Z | 2022-03-23T14:33:42.000Z | pyutilities/serve/standalone.py | intelzhangw2/Converter-for-OPCUA | 70860637798ca94224aec3663d3ea3674a963c5a | [
"Apache-2.0"
] | null | null | null | pyutilities/serve/standalone.py | intelzhangw2/Converter-for-OPCUA | 70860637798ca94224aec3663d3ea3674a963c5a | [
"Apache-2.0"
] | 29 | 2018-10-26T06:17:50.000Z | 2021-05-10T07:34:35.000Z | # --coding:utf-8--
# Copyright (c) 2017 Intel Corporation
#
# 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 l... | 29.71831 | 78 | 0.645024 |
import os
import queue
import sys
from optparse import OptionParser
sys.path.append('../../')
from pyutilities.serve.options import Options
from pyutilities.serve.daemon import daemonize
from pyutilities.serve.core import PluginManager
VERSION = 1.0
def main():
parser = OptionParser(usage='usag... | true | true |
f74ceb9568e36d6ee22864edba2a12bbca2a62f7 | 3,137 | py | Python | alipay/aop/api/domain/SubMerchantParams.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/SubMerchantParams.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/SubMerchantParams.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.constant.ParamConstants import *
class SubMerchantParams(object):
def __init__(self):
self._sub_merchant_id = None
self._sub_merchant_name = None
self._sub_merchant_service_description = None
... | 36.476744 | 115 | 0.685049 |
import simplejson as json
from alipay.aop.api.constant.ParamConstants import *
class SubMerchantParams(object):
def __init__(self):
self._sub_merchant_id = None
self._sub_merchant_name = None
self._sub_merchant_service_description = None
self._sub_merchant_service_name = None
... | true | true |
f74cebbd629618f6410ea1fab319b9210a277e59 | 1,932 | py | Python | net/layers.py | guoshuhong/Classification-networks | 0ca20964e64cf9001e2a770b2b44d88dcca04775 | [
"MIT"
] | null | null | null | net/layers.py | guoshuhong/Classification-networks | 0ca20964e64cf9001e2a770b2b44d88dcca04775 | [
"MIT"
] | null | null | null | net/layers.py | guoshuhong/Classification-networks | 0ca20964e64cf9001e2a770b2b44d88dcca04775 | [
"MIT"
] | null | null | null | from tensorflow import keras
import tensorflow as tf
class BatchNormalization(keras.layers.BatchNormalization):
"""
Identical to keras.layers.BatchNormalization, but adds the option to freeze parameters.
"""
def __init__(self, freeze, *args, **kwargs):
self.freeze = freeze
super(BatchN... | 33.894737 | 91 | 0.603002 | from tensorflow import keras
import tensorflow as tf
class BatchNormalization(keras.layers.BatchNormalization):
def __init__(self, freeze, *args, **kwargs):
self.freeze = freeze
super(BatchNormalization, self).__init__(*args, **kwargs)
self.trainable = not self.freeze
def ca... | true | true |
f74cecad11b09586695b070514d7c74296ec5b94 | 1,823 | py | Python | numba/type_inference/infer_call.py | shiquanwang/numba | a41c85fdd7d6abf8ea1ebe9116939ddc2217193b | [
"BSD-2-Clause"
] | 1 | 2015-11-05T19:33:18.000Z | 2015-11-05T19:33:18.000Z | numba/type_inference/infer_call.py | shiquanwang/numba | a41c85fdd7d6abf8ea1ebe9116939ddc2217193b | [
"BSD-2-Clause"
] | null | null | null | numba/type_inference/infer_call.py | shiquanwang/numba | a41c85fdd7d6abf8ea1ebe9116939ddc2217193b | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import
import numba
from numba import *
from numba import error, nodes
from numba.type_inference import module_type_inference
from numba import typesystem
if PY3:
import builtins
else:
import __builtin__ as builtins
debug = Fal... | 29.403226 | 70 | 0.702688 |
from __future__ import print_function, division, absolute_import
import numba
from numba import *
from numba import error, nodes
from numba.type_inference import module_type_inference
from numba import typesystem
if PY3:
import builtins
else:
import __builtin__ as builtins
debug = False
def resolve_functi... | true | true |
f74cecf60d8ab54e4fa072aef4c78720cfca7afb | 3,261 | py | Python | vae_torch/sample.py | aist9/autoencoder | b3b1ccbfff61883db06a6ca4506ca890eff08568 | [
"MIT"
] | 1 | 2021-02-17T04:22:10.000Z | 2021-02-17T04:22:10.000Z | vae_torch/sample.py | aist9/autoencoder | b3b1ccbfff61883db06a6ca4506ca890eff08568 | [
"MIT"
] | 26 | 2019-07-16T03:07:03.000Z | 2019-12-20T23:59:07.000Z | vae_torch/sample.py | aist9/autoencoder | b3b1ccbfff61883db06a6ca4506ca890eff08568 | [
"MIT"
] | 1 | 2021-02-10T08:03:08.000Z | 2021-02-10T08:03:08.000Z | # VAEのサンプルコード, MNIST使用
import numpy as np
import matplotlib.pyplot as plt
if __name__ == '__main__':
import sys
# コマンドライン引数を読み込み
# 引数が'-1'なら学習しない
args = sys.argv
train_mode = ['train', 'retrain', 'load']
mode = 0 if len(args) < 2 else int(args[1])
train_mode = train_mod... | 30.476636 | 151 | 0.624655 |
import numpy as np
import matplotlib.pyplot as plt
if __name__ == '__main__':
import sys
args = sys.argv
train_mode = ['train', 'retrain', 'load']
mode = 0 if len(args) < 2 else int(args[1])
train_mode = train_mode[mode]
import chainer
train, t... | true | true |
f74ced2529a889bc63d654dfe79103d3c78669ba | 681 | py | Python | tests/pipupgrade/test_table.py | max-nicholson/pipupgrade | 669cd4ecd4d858e6fb996e75af81960d0b35ccfb | [
"MIT"
] | 1 | 2021-02-02T19:08:14.000Z | 2021-02-02T19:08:14.000Z | tests/pipupgrade/test_table.py | max-nicholson/pipupgrade | 669cd4ecd4d858e6fb996e75af81960d0b35ccfb | [
"MIT"
] | null | null | null | tests/pipupgrade/test_table.py | max-nicholson/pipupgrade | 669cd4ecd4d858e6fb996e75af81960d0b35ccfb | [
"MIT"
] | null | null | null | # imports - module imports
from pipupgrade import cli
from pipupgrade.table import _sanitize_string, Table
def test__sanitize_string():
assert _sanitize_string(cli.format("foobar", cli.GREEN)) == "foobar"
assert _sanitize_string(cli.format("foobar", cli.BOLD)) == "foobar"
def test_table():
table =... | 25.222222 | 72 | 0.64464 |
from pipupgrade import cli
from pipupgrade.table import _sanitize_string, Table
def test__sanitize_string():
assert _sanitize_string(cli.format("foobar", cli.GREEN)) == "foobar"
assert _sanitize_string(cli.format("foobar", cli.BOLD)) == "foobar"
def test_table():
table = Table()
assert table.... | true | true |
f74cee003c3c4f2391f62fefc98bc111aa961f18 | 29,998 | py | Python | synapseclient/utils.py | zimingd/synapsePythonClient | 6bddd4d9de2f06f6f79d8ce814ac57970d6bebee | [
"Apache-2.0"
] | null | null | null | synapseclient/utils.py | zimingd/synapsePythonClient | 6bddd4d9de2f06f6f79d8ce814ac57970d6bebee | [
"Apache-2.0"
] | null | null | null | synapseclient/utils.py | zimingd/synapsePythonClient | 6bddd4d9de2f06f6f79d8ce814ac57970d6bebee | [
"Apache-2.0"
] | null | null | null | """
*****************
Utility Functions
*****************
Utility functions useful in the implementation and testing of the Synapse client.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from future.utils import ... | 32.92865 | 178 | 0.634709 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from future.utils import implements_iterator
from builtins import str
import six
try:
from urllib.parse import urlparse
from urllib.parse import urlencode
from... | true | true |
f74cee60ec6eb1ebac4c9593c6c8ae327160786f | 2,647 | py | Python | 3-Greedy Algorithms, Minimum Spanning Tree, and Dynamic Programming/2-Dynamic Programming/4-Sequence Alignment Problem/Two Strings Problems Using Dynamic Progamming/2-Longest Common Subsequence Problem/longest_common_subsequence.py | Ziang-Lu/Coursera-Algorithms-Stanford-U- | 936ef4230ca4f3d22008255e6feb1519ed646e79 | [
"MIT"
] | 25 | 2018-01-20T23:09:30.000Z | 2022-01-17T04:51:25.000Z | 3-Greedy Algorithms, Minimum Spanning Tree, and Dynamic Programming/2-Dynamic Programming/4-Sequence Alignment Problem/Two Strings Problems Using Dynamic Progamming/2-Longest Common Subsequence Problem/longest_common_subsequence.py | Ziang-Lu/Coursera-Algorithms-Stanford-U- | 936ef4230ca4f3d22008255e6feb1519ed646e79 | [
"MIT"
] | null | null | null | 3-Greedy Algorithms, Minimum Spanning Tree, and Dynamic Programming/2-Dynamic Programming/4-Sequence Alignment Problem/Two Strings Problems Using Dynamic Progamming/2-Longest Common Subsequence Problem/longest_common_subsequence.py | Ziang-Lu/Coursera-Algorithms-Stanford-U- | 936ef4230ca4f3d22008255e6feb1519ed646e79 | [
"MIT"
] | 10 | 2018-11-29T06:19:23.000Z | 2021-06-27T20:59:29.000Z | #!usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Given two strings X and Y of length m and n, respectively, find the longest
common subsequence (LCS).
Algorithm: (Dynamic programming)
Denote LCS(X, Y) to be the LCS of X and Y.
Consider the final characters x_m and y_n:
1. x_m and y_n are the same:
Let X' = {X - x... | 30.425287 | 80 | 0.546657 |
__author__ = 'Ziang Lu'
from typing import List
def longest_common_subsequence(x: str, y: str) -> List[str]:
if not x or not y:
return []
m, n = len(x), len(y)
subproblems = [[0 * (n + 1)] for _ in range(m + 1)]
for i in range(1, m + 1):
for j in range(1, n + 1):
... | true | true |
f74cefba2da868e0a28021fe4608f22c484c6e8e | 2,585 | py | Python | eval.py | JetBrains-Research/commit_message_generation | dc6efbb3fca92d8d289dfdfa6a1e2aad8932774e | [
"MIT"
] | 2 | 2021-08-07T23:05:39.000Z | 2021-12-20T09:55:53.000Z | eval.py | JetBrains-Research/commit_message_generation | dc6efbb3fca92d8d289dfdfa6a1e2aad8932774e | [
"MIT"
] | 1 | 2020-11-10T13:44:26.000Z | 2020-11-26T15:20:42.000Z | eval.py | saridormi/commit_message_generation | c25db61a5f41accfb566caaea5feb0d275751293 | [
"MIT"
] | null | null | null | import os
import pytorch_lightning as pl
import hydra
from hydra.utils import instantiate
from omegaconf import DictConfig, OmegaConf
from src.model import EncoderDecoderModule, GPT2LMHeadModule
from src.data_utils import CMGDataModule
@hydra.main(config_path="conf", config_name="config")
def main(cfg: DictConfig)... | 35.410959 | 111 | 0.589555 | import os
import pytorch_lightning as pl
import hydra
from hydra.utils import instantiate
from omegaconf import DictConfig, OmegaConf
from src.model import EncoderDecoderModule, GPT2LMHeadModule
from src.data_utils import CMGDataModule
@hydra.main(config_path="conf", config_name="config")
def main(cfg: DictConfig)... | true | true |
f74cefd439fb16c1712739e94c8fb19c93938c14 | 8,790 | py | Python | arvet_slam/metrics/frame_error/frame_error_update_denormalised_data.py | jskinn/arvet-slam | 94b1be30dd64a02ab3d7ac8b84292ba6d5b4153e | [
"BSD-2-Clause"
] | 4 | 2018-03-25T02:48:48.000Z | 2021-05-17T09:00:08.000Z | arvet_slam/metrics/frame_error/frame_error_update_denormalised_data.py | jskinn/arvet-slam | 94b1be30dd64a02ab3d7ac8b84292ba6d5b4153e | [
"BSD-2-Clause"
] | null | null | null | arvet_slam/metrics/frame_error/frame_error_update_denormalised_data.py | jskinn/arvet-slam | 94b1be30dd64a02ab3d7ac8b84292ba6d5b4153e | [
"BSD-2-Clause"
] | null | null | null | import logging
import time
from itertools import chain, zip_longest
from pymongo import UpdateMany
from pymodm.context_managers import no_auto_dereference
from arvet.core.system import VisionSystem
from arvet.core.trial_result import TrialResult
from arvet.core.image import Image
from arvet.core.image_source import Ima... | 49.106145 | 117 | 0.684414 | import logging
import time
from itertools import chain, zip_longest
from pymongo import UpdateMany
from pymodm.context_managers import no_auto_dereference
from arvet.core.system import VisionSystem
from arvet.core.trial_result import TrialResult
from arvet.core.image import Image
from arvet.core.image_source import Ima... | true | true |
f74cf043819371b1c2443a369762a91ed5d2116f | 7,536 | py | Python | embedutils/converters.py | zephyrkul/phen-cogs | 656cbab522ed085d70850da1a066c170cbbe92ed | [
"MIT"
] | null | null | null | embedutils/converters.py | zephyrkul/phen-cogs | 656cbab522ed085d70850da1a066c170cbbe92ed | [
"MIT"
] | null | null | null | embedutils/converters.py | zephyrkul/phen-cogs | 656cbab522ed085d70850da1a066c170cbbe92ed | [
"MIT"
] | null | null | null | import asyncio
import json
from typing import Dict, List, Optional, Union
import discord
import yaml
from redbot.core import commands
from redbot.core.commands import (
BadArgument,
CheckFailure,
Converter,
MessageConverter,
TextChannelConverter,
)
from redbot.core.utils import menus
class String... | 37.492537 | 100 | 0.616242 | import asyncio
import json
from typing import Dict, List, Optional, Union
import discord
import yaml
from redbot.core import commands
from redbot.core.commands import (
BadArgument,
CheckFailure,
Converter,
MessageConverter,
TextChannelConverter,
)
from redbot.core.utils import menus
class String... | true | true |
f74cf150c6708c379b58b0e5ddf07e5acfa9ce48 | 4,752 | py | Python | midstream/views.py | georgiawang5332/meatFoodManager | 204b5b7aa2a3c5a6c9cc38077a10a72c0c69f140 | [
"MIT"
] | null | null | null | midstream/views.py | georgiawang5332/meatFoodManager | 204b5b7aa2a3c5a6c9cc38077a10a72c0c69f140 | [
"MIT"
] | null | null | null | midstream/views.py | georgiawang5332/meatFoodManager | 204b5b7aa2a3c5a6c9cc38077a10a72c0c69f140 | [
"MIT"
] | null | null | null | from django.shortcuts import render, get_object_or_404, redirect
from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage
from django.db.models import Q
from django.http import HttpResponse, HttpResponseRedirect, Http404
from django.contrib import messages
from midstream.forms import *
# Create your ... | 32.326531 | 209 | 0.657828 | from django.shortcuts import render, get_object_or_404, redirect
from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage
from django.db.models import Q
from django.http import HttpResponse, HttpResponseRedirect, Http404
from django.contrib import messages
from midstream.forms import *
def create(re... | true | true |
f74cf16e91fc7ea19a01642f501e52fb01253c7e | 3,249 | py | Python | APIs/management/management/routers/addresses.py | matteyeux/MyBookingServices | ce6ec906b3a58da16e1f066b9af290fb7e8b82d3 | [
"MIT"
] | null | null | null | APIs/management/management/routers/addresses.py | matteyeux/MyBookingServices | ce6ec906b3a58da16e1f066b9af290fb7e8b82d3 | [
"MIT"
] | 3 | 2022-02-26T16:50:12.000Z | 2022-02-26T16:50:12.000Z | APIs/management/management/routers/addresses.py | matteyeux/MyBookingServices | ce6ec906b3a58da16e1f066b9af290fb7e8b82d3 | [
"MIT"
] | null | null | null | import os
from typing import Optional
from fastapi import APIRouter
from fastapi import HTTPException
from fastapi import Request
from management.models.addresses import Addresses
from management.utils import user_is_admin
from management.utils import user_logged
from pydantic import BaseModel
router = APIRouter()
... | 27.533898 | 76 | 0.693136 | import os
from typing import Optional
from fastapi import APIRouter
from fastapi import HTTPException
from fastapi import Request
from management.models.addresses import Addresses
from management.utils import user_is_admin
from management.utils import user_logged
from pydantic import BaseModel
router = APIRouter()
... | true | true |
f74cf24cd8c95488d288b4a2c551e0af3d5c443d | 114 | py | Python | ipywidgets/_version.py | minrk/ipython_widgets | a80597fd4c81dd75a2f610e376fe21a64e0df8d1 | [
"BSD-3-Clause"
] | 2 | 2019-05-15T03:10:38.000Z | 2020-10-08T08:08:24.000Z | ipywidgets/_version.py | minrk/ipython_widgets | a80597fd4c81dd75a2f610e376fe21a64e0df8d1 | [
"BSD-3-Clause"
] | 2 | 2015-12-29T18:03:24.000Z | 2016-05-19T06:26:50.000Z | ipywidgets/_version.py | minrk/ipython_widgets | a80597fd4c81dd75a2f610e376fe21a64e0df8d1 | [
"BSD-3-Clause"
] | 1 | 2020-05-14T14:32:56.000Z | 2020-05-14T14:32:56.000Z | version_info = (6, 0, 0, 'beta7')
__version__ = '.'.join(map(str, version_info))
__frontend_version__ = '^2.0.20'
| 28.5 | 46 | 0.675439 | version_info = (6, 0, 0, 'beta7')
__version__ = '.'.join(map(str, version_info))
__frontend_version__ = '^2.0.20'
| true | true |
f74cf35b76e4ab4dbb98854f098dd2d45783cde0 | 424 | py | Python | libs/interface.py | spidermila/mikrotik_control | 65bf4405be180cf5073cdb129aa345df4ddfac52 | [
"MIT"
] | null | null | null | libs/interface.py | spidermila/mikrotik_control | 65bf4405be180cf5073cdb129aa345df4ddfac52 | [
"MIT"
] | null | null | null | libs/interface.py | spidermila/mikrotik_control | 65bf4405be180cf5073cdb129aa345df4ddfac52 | [
"MIT"
] | 1 | 2022-03-20T02:57:03.000Z | 2022-03-20T02:57:03.000Z | class Interface:
def __init__(
self,
number: int,
name: str,
disabled: bool,
running: bool,
slave: bool,
dynamic: bool,
comment: str,
) -> None:
self.number = number
self.name = name
self.disabled = disabled
self.run... | 22.315789 | 32 | 0.514151 | class Interface:
def __init__(
self,
number: int,
name: str,
disabled: bool,
running: bool,
slave: bool,
dynamic: bool,
comment: str,
) -> None:
self.number = number
self.name = name
self.disabled = disabled
self.run... | true | true |
f74cf36922d66a0003ccd3a85420fdeac4e3725f | 1,283 | py | Python | youtube_dl_client.py | franciscoGPS/youtdl | 85b7530f9e01386b1baa1d7531a01d90b1e97cd2 | [
"Apache-2.0"
] | null | null | null | youtube_dl_client.py | franciscoGPS/youtdl | 85b7530f9e01386b1baa1d7531a01d90b1e97cd2 | [
"Apache-2.0"
] | null | null | null | youtube_dl_client.py | franciscoGPS/youtdl | 85b7530f9e01386b1baa1d7531a01d90b1e97cd2 | [
"Apache-2.0"
] | null | null | null | from __future__ import unicode_literals
import youtube_dl
class YoutubeDLClient():
"""docstring for YoutubeDLClient"""
def __init__(self, ydl_opts):
ydl_opts.update({'logger': self.MyLogger()})
ydl_opts.update({'progress_hooks': [self.my_hook]})
self.ydl_opts = ydl_opts
self.ydl... | 27.297872 | 66 | 0.538581 | from __future__ import unicode_literals
import youtube_dl
class YoutubeDLClient():
def __init__(self, ydl_opts):
ydl_opts.update({'logger': self.MyLogger()})
ydl_opts.update({'progress_hooks': [self.my_hook]})
self.ydl_opts = ydl_opts
self.ydl = youtube_dl.YoutubeDL(ydl_opts)
... | true | true |
f74cf3ac034cdda587e6101224f62d913c8d848e | 223 | py | Python | mp/core/framework.py | kerryeon/mp_python | 1aca4069bc635959fa4f3ce94507c55226219039 | [
"MIT"
] | 1 | 2021-04-08T01:59:11.000Z | 2021-04-08T01:59:11.000Z | mp/core/framework.py | kerryeon/mp_python | 1aca4069bc635959fa4f3ce94507c55226219039 | [
"MIT"
] | null | null | null | mp/core/framework.py | kerryeon/mp_python | 1aca4069bc635959fa4f3ce94507c55226219039 | [
"MIT"
] | null | null | null | import numpy as np
MAP_NUM_TYPE = {
# bool-type is not supported
'b': np.bool_,
'i8': np.uint8,
'i32': np.int32,
'i64': np.int64,
'f16': np.float16,
'f32': np.float32,
'f64': np.float64,
}
| 15.928571 | 32 | 0.547085 | import numpy as np
MAP_NUM_TYPE = {
'b': np.bool_,
'i8': np.uint8,
'i32': np.int32,
'i64': np.int64,
'f16': np.float16,
'f32': np.float32,
'f64': np.float64,
}
| true | true |
f74cf420f6672be7a50384579ebb67c9a596cb62 | 3,215 | py | Python | linkedin_matrix/db/upgrade/v01_initial_revision.py | sumnerevans/mautrix-linkedin | 4d9b3feb8b6d7b7cba534cfaef93582814586958 | [
"Apache-2.0"
] | 9 | 2021-06-10T11:22:37.000Z | 2021-07-14T14:31:35.000Z | linkedin_matrix/db/upgrade/v01_initial_revision.py | sumnerevans/linkedin-matrix | 4d9b3feb8b6d7b7cba534cfaef93582814586958 | [
"Apache-2.0"
] | 55 | 2021-06-04T03:04:53.000Z | 2021-07-13T03:01:15.000Z | linkedin_matrix/db/upgrade/v01_initial_revision.py | sumnerevans/mautrix-linkedin | 4d9b3feb8b6d7b7cba534cfaef93582814586958 | [
"Apache-2.0"
] | null | null | null | from asyncpg import Connection
from . import upgrade_table
@upgrade_table.register(description="Initial asyncpg revision", transaction=False)
async def upgrade_v1(conn: Connection):
create_table_queries = [
"""
CREATE TABLE "user" (
mxid TEXT PRIMARY KEY,
li_mem... | 29.495413 | 82 | 0.479938 | from asyncpg import Connection
from . import upgrade_table
@upgrade_table.register(description="Initial asyncpg revision", transaction=False)
async def upgrade_v1(conn: Connection):
create_table_queries = [
"""
CREATE TABLE "user" (
mxid TEXT PRIMARY KEY,
li_mem... | true | true |
f74cf537f9ac147d06a9262730e0ed6c8c75d50c | 1,605 | py | Python | digits/download_data/__main__.py | 4QuantOSS/OpenDIGITS | f7969aef0f91d074d09290261ca36e2e93128276 | [
"BSD-3-Clause"
] | 2 | 2018-05-09T05:54:37.000Z | 2018-05-13T14:18:03.000Z | digits/download_data/__main__.py | 4QuantOSS/OpenDIGITS | f7969aef0f91d074d09290261ca36e2e93128276 | [
"BSD-3-Clause"
] | null | null | null | digits/download_data/__main__.py | 4QuantOSS/OpenDIGITS | f7969aef0f91d074d09290261ca36e2e93128276 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import print_function
from __future__ import absolute_import
# Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved.
import argparse
import sys
import time
from .cifar10 import Cifar10Downloader
from .cifar100 import Cifar100Downloader
from .mnist import MnistDownloader
if __name__ == '_... | 28.157895 | 79 | 0.576324 | from __future__ import print_function
from __future__ import absolute_import
import argparse
import sys
import time
from .cifar10 import Cifar10Downloader
from .cifar100 import Cifar100Downloader
from .mnist import MnistDownloader
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Download... | true | true |
f74cf58aef1b16d864d26ca77026a62d5f47e48f | 90,354 | py | Python | peter_sslers/lib/db/get.py | aptise/peter_sslers | 1dcae3fee0c1f4c67ae8a614aed7e2a3121e88b0 | [
"MIT"
] | 35 | 2016-04-21T18:55:31.000Z | 2022-03-30T08:22:43.000Z | peter_sslers/lib/db/get.py | aptise/peter_sslers | 1dcae3fee0c1f4c67ae8a614aed7e2a3121e88b0 | [
"MIT"
] | 8 | 2018-05-23T13:38:49.000Z | 2021-03-19T21:05:44.000Z | peter_sslers/lib/db/get.py | aptise/peter_sslers | 1dcae3fee0c1f4c67ae8a614aed7e2a3121e88b0 | [
"MIT"
] | 2 | 2016-08-18T21:07:11.000Z | 2017-01-11T09:47:40.000Z | # logging
import logging
log = logging.getLogger(__name__)
# stdlib
import datetime
# pypi
import sqlalchemy
# localapp
from ... import lib
from .. import utils
from ...model import utils as model_utils
from ...model import objects as model_objects
# ===============================================================... | 31.770042 | 126 | 0.65302 |
import logging
log = logging.getLogger(__name__)
import datetime
import sqlalchemy
from ... import lib
from .. import utils
from ...model import utils as model_utils
from ...model import objects as model_objects
def get__AcmeEventLog__count(ctx):
counted = ctx.dbSession.query(model_objects.AcmeEventLog... | true | true |
f74cf71883f97756a405a10c859515f5aac34653 | 1,745 | py | Python | metaci/testresults/migrations/0019_auto_20201016_1935.py | sfdc-qbranch/MetaCI | 78ac0d2bccd2db381998321ebd71029dd5d9ab39 | [
"BSD-3-Clause"
] | 48 | 2018-10-24T14:52:06.000Z | 2022-03-25T21:14:50.000Z | metaci/testresults/migrations/0019_auto_20201016_1935.py | sfdc-qbranch/MetaCI | 78ac0d2bccd2db381998321ebd71029dd5d9ab39 | [
"BSD-3-Clause"
] | 2,034 | 2018-10-31T20:59:16.000Z | 2022-03-22T21:38:03.000Z | metaci/testresults/migrations/0019_auto_20201016_1935.py | sfdc-qbranch/MetaCI | 78ac0d2bccd2db381998321ebd71029dd5d9ab39 | [
"BSD-3-Clause"
] | 27 | 2018-12-24T18:16:23.000Z | 2021-12-15T17:57:27.000Z | # Generated by Django 2.2.16 on 2020-10-16 19:35
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("testresults", "0018_testresult_robot_tags"),
]
operations = [
migrations.AlterField(
model_name="testresult",
name=... | 32.314815 | 74 | 0.591404 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("testresults", "0018_testresult_robot_tags"),
]
operations = [
migrations.AlterField(
model_name="testresult",
name="email_invocations_allowed",
field=m... | true | true |
f74cf73c498658e6d4ed787f5f4d671984a52111 | 1,194 | py | Python | algorithm/neural-network/XOR.py | mk43/machine-learning | 1ca1baf797fe6f593a88ad4e0d7ac7e5c24ce139 | [
"Apache-2.0"
] | 6 | 2018-02-22T00:27:44.000Z | 2019-11-21T18:12:48.000Z | algorithm/neural-network/XOR.py | mk43/machine-learning | 1ca1baf797fe6f593a88ad4e0d7ac7e5c24ce139 | [
"Apache-2.0"
] | null | null | null | algorithm/neural-network/XOR.py | mk43/machine-learning | 1ca1baf797fe6f593a88ad4e0d7ac7e5c24ce139 | [
"Apache-2.0"
] | 4 | 2018-02-19T05:59:23.000Z | 2020-04-08T08:53:02.000Z | # coding: utf-8
import numpy as np
x1 = np.asarray([0, 0, 1, 1])
x2 = np.asarray([0, 1, 0, 1])
X = np.row_stack((np.ones(shape=(1, 4)), x1, x2))
print("X:\n%s" % X)
y = np.asarray([0, 1, 1, 0])
W1 = np.asarray([[-1, 2, -2],
[-1, -2, 2]])
W2 = np.asarray([-1, 2, 2])
def sigmoid(input):
return 1 ... | 23.88 | 55 | 0.463987 |
import numpy as np
x1 = np.asarray([0, 0, 1, 1])
x2 = np.asarray([0, 1, 0, 1])
X = np.row_stack((np.ones(shape=(1, 4)), x1, x2))
print("X:\n%s" % X)
y = np.asarray([0, 1, 1, 0])
W1 = np.asarray([[-1, 2, -2],
[-1, -2, 2]])
W2 = np.asarray([-1, 2, 2])
def sigmoid(input):
return 1 / (1 + np.power... | true | true |
f74cf7e04b78d92e4029b5aebb44fe312293709d | 584 | py | Python | otcore/occurrence/migrations/0003_auto_20160504_0937.py | NYULibraries/dlts-enm-tct-backend | 07455a660fb2cb8bc91a54f7f12d150923678157 | [
"Apache-2.0"
] | null | null | null | otcore/occurrence/migrations/0003_auto_20160504_0937.py | NYULibraries/dlts-enm-tct-backend | 07455a660fb2cb8bc91a54f7f12d150923678157 | [
"Apache-2.0"
] | 2 | 2017-10-30T21:19:07.000Z | 2017-10-31T18:06:30.000Z | otcore/occurrence/migrations/0003_auto_20160504_0937.py | NYULibraries/dlts-enm-tct-backend | 07455a660fb2cb8bc91a54f7f12d150923678157 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-05-04 13:37
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('occurrence', '0002_auto_20160415_1549'),
]
operatio... | 26.545455 | 144 | 0.659247 |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('occurrence', '0002_auto_20160415_1549'),
]
operations = [
migrations.AlterField(
model_name='occurren... | true | true |
f74cf91c1d69e4d676250648c48515c5d9b1c4e1 | 957 | py | Python | L1Trigger/L1TGlobal/python/PrescalesVetos_cff.py | menglu21/cmssw | c3d6cb102c0aaddf652805743370c28044d53da6 | [
"Apache-2.0"
] | null | null | null | L1Trigger/L1TGlobal/python/PrescalesVetos_cff.py | menglu21/cmssw | c3d6cb102c0aaddf652805743370c28044d53da6 | [
"Apache-2.0"
] | null | null | null | L1Trigger/L1TGlobal/python/PrescalesVetos_cff.py | menglu21/cmssw | c3d6cb102c0aaddf652805743370c28044d53da6 | [
"Apache-2.0"
] | null | null | null | #
# WARNING: This file is in the L1T configuration critical path.
#
# All changes must be explicitly discussed with the L1T offline coordinator.
#
import FWCore.ParameterSet.Config as cms
L1TGlobalPrescalesVetosRcdSource = cms.ESSource("EmptyESSource",
recordName = cms.string('L1TGlobalPrescalesVetosRcd'),
iov... | 38.28 | 94 | 0.789969 |
import FWCore.ParameterSet.Config as cms
L1TGlobalPrescalesVetosRcdSource = cms.ESSource("EmptyESSource",
recordName = cms.string('L1TGlobalPrescalesVetosRcd'),
iovIsRunNotTime = cms.bool(True),
firstValid = cms.vuint32(1)
)
L1TGlobalPrescalesVetos = cms.ESProducer("L1TGlobalPrescalesVetosESProducer"... | true | true |
f74cf9818eac25e58299b018cba1d6f13cf4a2d6 | 1,788 | py | Python | examples/gan/gan_run.py | birdiesanders/zenml | fca11c17ccf941aa14920ef4eab470b94b26ccbe | [
"Apache-2.0"
] | 1 | 2021-05-04T17:11:23.000Z | 2021-05-04T17:11:23.000Z | examples/gan/gan_run.py | birdiesanders/zenml | fca11c17ccf941aa14920ef4eab470b94b26ccbe | [
"Apache-2.0"
] | null | null | null | examples/gan/gan_run.py | birdiesanders/zenml | fca11c17ccf941aa14920ef4eab470b94b26ccbe | [
"Apache-2.0"
] | 1 | 2020-12-27T08:16:42.000Z | 2020-12-27T08:16:42.000Z | # Copyright (c) maiot GmbH 2020. 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 applica... | 38.042553 | 98 | 0.722595 |
from zenml.core.datasources.image_datasource import ImageDatasource
from zenml.core.pipelines.training_pipeline import TrainingPipeline
from zenml.core.steps.split.categorical_domain_split_step import \
CategoricalDomainSplit
from zenml.core.repo.repo import Repository
from examples.gan.gan_functions ... | true | true |
f74cfa5de40c148055138b1e3df9c69523326dd0 | 10,653 | py | Python | tensorflow_datasets/object_detection/kitti.py | shubhamkumaR630/datasets | fe9ee91849cefed0953141ea3588f73b7def78fd | [
"Apache-2.0"
] | 2 | 2022-02-14T09:51:39.000Z | 2022-02-14T13:27:49.000Z | tensorflow_datasets/object_detection/kitti.py | shubhamkumaR630/datasets | fe9ee91849cefed0953141ea3588f73b7def78fd | [
"Apache-2.0"
] | null | null | null | tensorflow_datasets/object_detection/kitti.py | shubhamkumaR630/datasets | fe9ee91849cefed0953141ea3588f73b7def78fd | [
"Apache-2.0"
] | 1 | 2020-12-13T22:11:33.000Z | 2020-12-13T22:11:33.000Z | # coding=utf-8
# Copyright 2022 The TensorFlow Datasets 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 appl... | 34.144231 | 82 | 0.653994 |
import collections
import csv
import os
import numpy as np
import tensorflow as tf
import tensorflow_datasets.public_api as tfds
_CITATION = """\
@inproceedings{Geiger2012CVPR,
author = {Andreas Geiger and Philip Lenz and Raquel Urtasun},
title = {Are we ready for Autonomous Driving? The KITTI Visi... | true | true |
f74cfac82196445d75509fe47d7d143c870fb21e | 908 | py | Python | molecule/default/tests/test_installation.py | infOpen/ansible-role-xvfb | 3858d3002ea38d610c98ee3d4e3ba0d8c858befb | [
"MIT"
] | 2 | 2019-01-23T19:32:38.000Z | 2020-07-25T11:10:18.000Z | molecule/default/tests/test_installation.py | infOpen/ansible-role-xvfb | 3858d3002ea38d610c98ee3d4e3ba0d8c858befb | [
"MIT"
] | 173 | 2018-04-05T20:38:50.000Z | 2022-03-23T19:07:51.000Z | molecule/default/tests/test_installation.py | infOpen/ansible-role-xvfb | 3858d3002ea38d610c98ee3d4e3ba0d8c858befb | [
"MIT"
] | null | null | null | """
Role tests
"""
import os
from testinfra.utils.ansible_runner import AnsibleRunner
testinfra_hosts = AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_package(host):
"""
Ensure package installed
"""
if host.system_info.distribution in ('debian', 'ubuntu'):
... | 20.636364 | 74 | 0.672907 |
import os
from testinfra.utils.ansible_runner import AnsibleRunner
testinfra_hosts = AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_package(host):
if host.system_info.distribution in ('debian', 'ubuntu'):
assert host.package('xvfb').is_installed
else:
as... | true | true |
f74cfccbdb98d4d5b39947d817b4cc0e71ad4550 | 6,906 | py | Python | backend/vpn_30372/settings.py | crowdbotics-apps/vpn-30372 | 3a2195421c9ef62471ebab8b8e7144e633f317f3 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/vpn_30372/settings.py | crowdbotics-apps/vpn-30372 | 3a2195421c9ef62471ebab8b8e7144e633f317f3 | [
"FTL",
"AML",
"RSA-MD"
] | 11 | 2021-09-13T03:33:33.000Z | 2021-11-28T17:24:55.000Z | backend/vpn_30372/settings.py | crowdbotics-apps/vpn-30372 | 3a2195421c9ef62471ebab8b8e7144e633f317f3 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | """
Django settings for vpn_30372 project.
Generated by 'django-admin startproject' using Django 2.2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
... | 29.512821 | 112 | 0.73009 |
import os
import environ
import logging
from modules.manifest import get_modules
env = environ.Env()
DEBUG = env.bool("DEBUG", default=False)
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development se... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.