hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f731514ce63880879d8950cd12e196a3a011a776 | 11,680 | py | Python | chives/util/merkle_set.py | zcomputerwiz/chives-light-wallet | b5f57f46bf4f804cc06a6e2bdf8cbde41bba2fe0 | [
"Apache-2.0"
] | null | null | null | chives/util/merkle_set.py | zcomputerwiz/chives-light-wallet | b5f57f46bf4f804cc06a6e2bdf8cbde41bba2fe0 | [
"Apache-2.0"
] | null | null | null | chives/util/merkle_set.py | zcomputerwiz/chives-light-wallet | b5f57f46bf4f804cc06a6e2bdf8cbde41bba2fe0 | [
"Apache-2.0"
] | 1 | 2022-03-20T16:19:04.000Z | 2022-03-20T16:19:04.000Z | from abc import ABCMeta, abstractmethod
from hashlib import sha256
from typing import Any, Dict, List, Tuple
from chives.types.blockchain_format.sized_bytes import bytes32
"""
A simple, confidence-inspiring Merkle Set standard
Advantages of this standard:
Low CPU requirements
Small proofs of inclusion/exclusion
Reas... | 29.054726 | 112 | 0.617894 | from abc import ABCMeta, abstractmethod
from hashlib import sha256
from typing import Any, Dict, List, Tuple
from chives.types.blockchain_format.sized_bytes import bytes32
EMPTY = bytes([0])
TERMINAL = bytes([1])
MIDDLE = bytes([2])
TRUNCATED = bytes([3])
BLANK = bytes32([0] * 32)
prehashed: Dict[bytes, Any] = {}
... | true | true |
f73151573f84138e26ebce007711c74837f84410 | 16,958 | py | Python | colour/characterisation/datasets/cameras/dslr/sensitivities.py | aurelienpierre/colour | 3ac45c12fbc0493e49ba4d4b2cb253df9fe14c47 | [
"BSD-3-Clause"
] | null | null | null | colour/characterisation/datasets/cameras/dslr/sensitivities.py | aurelienpierre/colour | 3ac45c12fbc0493e49ba4d4b2cb253df9fe14c47 | [
"BSD-3-Clause"
] | null | null | null | colour/characterisation/datasets/cameras/dslr/sensitivities.py | aurelienpierre/colour | 3ac45c12fbc0493e49ba4d4b2cb253df9fe14c47 | [
"BSD-3-Clause"
] | null | null | null | """
Sensitivities of *DSLR* Cameras
===============================
Defines the sensitivities of *DSLR* cameras.
Each *DSLR* camera data is in the form of a *dict* of
:class:`colour.characterisation.RGB_CameraSensitivities` classes as follows::
{
'name': RGB_CameraSensitivities,
...,
'nam... | 27.046252 | 78 | 0.513445 |
from __future__ import annotations
from functools import partial
from colour.characterisation import RGB_CameraSensitivities
from colour.hints import Dict
from colour.utilities import LazyCaseInsensitiveMapping
__author__ = "Colour Developers"
__copyright__ = "Copyright 2013 Colour Developers"
__license__ = "New BS... | true | true |
f731522e9661ea03a15b6c0891cbf1369590cc3e | 5,128 | py | Python | youtubeto/raindrop.py | Perlence/youtube-to | b0183719f3c40825f7fab520294bd55574fde581 | [
"BSD-3-Clause"
] | 1 | 2021-06-18T22:34:00.000Z | 2021-06-18T22:34:00.000Z | youtubeto/raindrop.py | Perlence/youtube-to | b0183719f3c40825f7fab520294bd55574fde581 | [
"BSD-3-Clause"
] | null | null | null | youtubeto/raindrop.py | Perlence/youtube-to | b0183719f3c40825f7fab520294bd55574fde581 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
from gevent import monkey
monkey.patch_all(thread=False, select=False)
import json
import arrow
from apiclient.discovery import build
from gevent.pool import Pool
from httplib2 import Http
from logbook import Logger
from oauth2client import client
from . import config
logger ... | 33.736842 | 77 | 0.633385 | from __future__ import absolute_import
from gevent import monkey
monkey.patch_all(thread=False, select=False)
import json
import arrow
from apiclient.discovery import build
from gevent.pool import Pool
from httplib2 import Http
from logbook import Logger
from oauth2client import client
from . import config
logger ... | true | true |
f731523ad4d8e5ca45ea9d3c2e855ab60f507b2e | 31 | py | Python | nso_restconf/__init__.py | rtrjl/nso_restconf | f5b8aa1cd857bf79732273c51f8dc6df13df030f | [
"BSD-Source-Code"
] | 1 | 2022-02-04T13:44:49.000Z | 2022-02-04T13:44:49.000Z | nso_restconf/__init__.py | rtrjl/nso_restconf | f5b8aa1cd857bf79732273c51f8dc6df13df030f | [
"BSD-Source-Code"
] | null | null | null | nso_restconf/__init__.py | rtrjl/nso_restconf | f5b8aa1cd857bf79732273c51f8dc6df13df030f | [
"BSD-Source-Code"
] | null | null | null | from .restconf import RestConf
| 15.5 | 30 | 0.83871 | from .restconf import RestConf
| true | true |
f73152526fda44eeae7cc9b1ebdfc4befe32c01d | 13,312 | py | Python | tests/integration/cloud/helpers/cloud_test_base.py | HudsonWu/mysalt | 8ce2f66e0d0338157923f0ea0dab912a0f43e52e | [
"Apache-2.0"
] | null | null | null | tests/integration/cloud/helpers/cloud_test_base.py | HudsonWu/mysalt | 8ce2f66e0d0338157923f0ea0dab912a0f43e52e | [
"Apache-2.0"
] | null | null | null | tests/integration/cloud/helpers/cloud_test_base.py | HudsonWu/mysalt | 8ce2f66e0d0338157923f0ea0dab912a0f43e52e | [
"Apache-2.0"
] | null | null | null | """
Tests for the Openstack Cloud Provider
"""
import logging
import os
import shutil
from time import sleep
import salt.utils.verify
from salt.config import cloud_config, cloud_providers_config
from salt.ext.six.moves import range
from salt.utils.yaml import safe_load
from tests.support.case import ShellCase
from t... | 37.498592 | 126 | 0.558293 |
import logging
import os
import shutil
from time import sleep
import salt.utils.verify
from salt.config import cloud_config, cloud_providers_config
from salt.ext.six.moves import range
from salt.utils.yaml import safe_load
from tests.support.case import ShellCase
from tests.support.helpers import expensiveTest, rand... | true | true |
f7315522e3755914ebfefcdfd231697126d0ee40 | 49,362 | py | Python | path-finding/yolo-v5/utils/datasets.py | sa-y-an/open-source-autonomous-vehicle-controller | 0cc415fb141d1b66ac45a7bf6b50add6814728fb | [
"MIT"
] | 3 | 2021-06-15T05:10:00.000Z | 2021-09-05T18:07:01.000Z | utils/datasets.py | z430/yolov5-mask-detection | b959a4fefa1d44d052436ff9129af386e15e0455 | [
"MIT"
] | 1 | 2021-06-07T21:05:14.000Z | 2021-06-07T21:05:14.000Z | utils/datasets.py | z430/yolov5-mask-detection | b959a4fefa1d44d052436ff9129af386e15e0455 | [
"MIT"
] | 9 | 2021-06-10T08:42:53.000Z | 2022-03-28T05:46:16.000Z | # Dataset utils and dataloaders
import glob
import hashlib
import json
import logging
import os
import random
import shutil
import time
from itertools import repeat
from multiprocessing.pool import ThreadPool, Pool
from pathlib import Path
from threading import Thread
import cv2
import math
import numpy as np
import ... | 42.590164 | 120 | 0.548803 |
import glob
import hashlib
import json
import logging
import os
import random
import shutil
import time
from itertools import repeat
from multiprocessing.pool import ThreadPool, Pool
from pathlib import Path
from threading import Thread
import cv2
import math
import numpy as np
import torch
import torch.nn.functional... | true | true |
f7315650becb2c94bec9837ddd60b3d1e3e2b7d1 | 2,007 | py | Python | extra/face.py | Leyan529/ImageClassificationPL | a4be75f4525828100d8d278e46ff5dccd829af1a | [
"MIT"
] | null | null | null | extra/face.py | Leyan529/ImageClassificationPL | a4be75f4525828100d8d278e46ff5dccd829af1a | [
"MIT"
] | null | null | null | extra/face.py | Leyan529/ImageClassificationPL | a4be75f4525828100d8d278e46ff5dccd829af1a | [
"MIT"
] | null | null | null | import torch
import matplotlib.image as img
import cv2
import dlib
from imutils.face_utils import *
import numpy as np
# image = img.imread("extra//test.jpg")
# image = cv2.cvtColor(np.array(image), cv2.COLOR_RGB2BGR) # opencvImage
dlib_path = 'extra//shape_predictor_68_face_landmarks.dat'
def get_fac... | 35.210526 | 116 | 0.605879 | import torch
import matplotlib.image as img
import cv2
import dlib
from imutils.face_utils import *
import numpy as np
dlib_path = 'extra//shape_predictor_68_face_landmarks.dat'
def get_face(img):
global detector, landmark_predictor
detector = dlib.get_frontal_face_detector()
landmark... | true | true |
f731574329fa3890c3eac2e8b58b5c9c180f7338 | 1,636 | py | Python | src/Filtering/BinaryMathematicalMorphology/DilateABinaryImage/Code.py | justbennet/ITKExamples | cde3b1bfb396042050c399b4bae59c338cf646f2 | [
"Apache-2.0"
] | null | null | null | src/Filtering/BinaryMathematicalMorphology/DilateABinaryImage/Code.py | justbennet/ITKExamples | cde3b1bfb396042050c399b4bae59c338cf646f2 | [
"Apache-2.0"
] | null | null | null | src/Filtering/BinaryMathematicalMorphology/DilateABinaryImage/Code.py | justbennet/ITKExamples | cde3b1bfb396042050c399b4bae59c338cf646f2 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright NumFOCUS
#
# 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.txt
#
# Unless required by applicable law or ... | 30.296296 | 75 | 0.732274 |
import sys
import itk
if len(sys.argv) != 4:
print("Usage: " + sys.argv[0] + " <inputImage> <outputImage> <radius>")
sys.exit(1)
inputImage = sys.argv[1]
outputImage = sys.argv[2]
radiusValue = int(sys.argv[3])
PixelType = itk.UC
Dimension = 2
ImageType = itk.Image[PixelType, Dimension]
ReaderType = itk.... | true | true |
f731577f3eb816602726166e59d42f01b5f4b241 | 9,919 | py | Python | src/sasctl/utils/cli.py | brtieu/python-sasctl | 1eed427c39faaddda78dec4806f12f3f8964890e | [
"Apache-2.0"
] | 30 | 2019-07-12T00:18:21.000Z | 2022-03-18T08:36:35.000Z | src/sasctl/utils/cli.py | brtieu/python-sasctl | 1eed427c39faaddda78dec4806f12f3f8964890e | [
"Apache-2.0"
] | 89 | 2019-07-12T20:46:46.000Z | 2022-03-29T16:16:46.000Z | src/sasctl/utils/cli.py | brtieu/python-sasctl | 1eed427c39faaddda78dec4806f12f3f8964890e | [
"Apache-2.0"
] | 41 | 2019-07-11T15:08:55.000Z | 2022-01-10T05:30:50.000Z | #!/usr/bin/env python
# encoding: utf-8
#
# Copyright © 2019, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
import argparse
import inspect
import json
import logging
import os
import pkgutil
import warnings
from collections import namedtuple, defaultdict
from importlib ... | 32.521311 | 97 | 0.569311 |
import argparse
import inspect
import json
import logging
import os
import pkgutil
import warnings
from collections import namedtuple, defaultdict
from importlib import import_module
from pprint import pprint
ArgInfo = namedtuple('ArgInfo', ['name', 'type', 'required', 'default', 'doc'])
def sasctl_command(name, s... | true | true |
f731586ef1b81b7d4f26fef5e91e60a95e44ab32 | 28 | py | Python | purectypes/struct_value.py | aguinet/purectypes | e1db225ba865468b1f0d2fe017a7291da41acbfd | [
"Apache-2.0"
] | 19 | 2020-02-22T12:29:39.000Z | 2021-10-02T02:36:01.000Z | purectypes/struct_value.py | aguinet/purectypes | e1db225ba865468b1f0d2fe017a7291da41acbfd | [
"Apache-2.0"
] | null | null | null | purectypes/struct_value.py | aguinet/purectypes | e1db225ba865468b1f0d2fe017a7291da41acbfd | [
"Apache-2.0"
] | 2 | 2020-02-22T12:29:46.000Z | 2020-10-11T18:48:53.000Z | class StructValue:
pass
| 9.333333 | 18 | 0.714286 | class StructValue:
pass
| true | true |
f731592f46955b17ebfec9140599ba5b56cb5dab | 33,850 | py | Python | mlflow/pyfunc/__init__.py | washcycle/mlflow | 5a60ab34a4cecfe0b9636f6df77c087faa8b6959 | [
"Apache-2.0"
] | 3 | 2018-10-16T16:34:46.000Z | 2020-01-08T09:34:34.000Z | mlflow/pyfunc/__init__.py | washcycle/mlflow | 5a60ab34a4cecfe0b9636f6df77c087faa8b6959 | [
"Apache-2.0"
] | null | null | null | mlflow/pyfunc/__init__.py | washcycle/mlflow | 5a60ab34a4cecfe0b9636f6df77c087faa8b6959 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
The ``mlflow.pyfunc`` module defines a generic :ref:`filesystem format <pyfunc-filesystem-format>`
for Python models and provides utilities for saving to and loading from this format. The format is
self contained in the sense that it includes all necessary information for anyone to load it ... | 46.883657 | 100 | 0.65288 |
import importlib
import logging
import numpy as np
import os
import pandas
import shutil
from copy import deepcopy
import mlflow
import mlflow.pyfunc.model
import mlflow.pyfunc.utils
from mlflow.models import Model
from mlflow.pyfunc.model import PythonModel, PythonModelContext, get_default_conda_env
from mlflow.tra... | true | true |
f7315a0806862ec68601ee3196af37bdc53af7a3 | 3,235 | py | Python | pypureclient/flasharray/FA_2_5/models/certificate_signing_request_response.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 14 | 2018-12-07T18:30:27.000Z | 2022-02-22T09:12:33.000Z | pypureclient/flasharray/FA_2_5/models/certificate_signing_request_response.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 28 | 2019-09-17T21:03:52.000Z | 2022-03-29T22:07:35.000Z | pypureclient/flasharray/FA_2_5/models/certificate_signing_request_response.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 15 | 2020-06-11T15:50:08.000Z | 2022-03-21T09:27:25.000Z | # coding: utf-8
"""
FlashArray REST API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 2.5
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re
import six
import typing
from .... | 28.883929 | 105 | 0.559505 |
import pprint
import re
import six
import typing
from ....properties import Property
if typing.TYPE_CHECKING:
from pypureclient.flasharray.FA_2_5 import models
class CertificateSigningRequestResponse(object):
swagger_types = {
'items': 'list[CertificateSigningRequest]'
}
attribute_map = {... | true | true |
f7315a1e62e3e9a93eec26f0b1922799b57e4925 | 6,815 | py | Python | resources.py | vermeulendivan/qgis-pipelineplanner | b0d0c05626401b874a193fe358eec6146a204fff | [
"MIT"
] | null | null | null | resources.py | vermeulendivan/qgis-pipelineplanner | b0d0c05626401b874a193fe358eec6146a204fff | [
"MIT"
] | null | null | null | resources.py | vermeulendivan/qgis-pipelineplanner | b0d0c05626401b874a193fe358eec6146a204fff | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Resource object code
#
# Created by: The Resource Compiler for PyQt5 (Qt v5.15.2)
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore
qt_resource_data = b"\
\x00\x00\x04\xa5\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
... | 49.028777 | 122 | 0.711812 |
from PyQt5 import QtCore
qt_resource_data = b"\
\x00\x00\x04\xa5\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x18\x00\x00\x00\x18\x08\x02\x00\x00\x00\x6f\x15\xaa\xaf\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x04\x67\x41\x4d\x41\x00\x00\xb1\x8f\... | true | true |
f7315ba8d23659f4ee2ea63c31b028bd2c878b21 | 182 | py | Python | problem0153.py | kmarcini/Project-Euler-Python | d644e8e1ec4fac70a9ab407ad5e1f0a75547c8d3 | [
"BSD-3-Clause"
] | null | null | null | problem0153.py | kmarcini/Project-Euler-Python | d644e8e1ec4fac70a9ab407ad5e1f0a75547c8d3 | [
"BSD-3-Clause"
] | null | null | null | problem0153.py | kmarcini/Project-Euler-Python | d644e8e1ec4fac70a9ab407ad5e1f0a75547c8d3 | [
"BSD-3-Clause"
] | null | null | null | ###########################
#
# #153 Investigating Gaussian Integers - Project Euler
# https://projecteuler.net/problem=153
#
# Code by Kevin Marciniak
#
###########################
| 20.222222 | 54 | 0.516484 | true | true | |
f7315cfdfc21364f14a0e03bb86bc6f1b502fcd9 | 349 | py | Python | Code/Python2.7/Kattis/08synlists.py | nicholasz2510/General | e2783cad4da7f9b50c952c2b91ef311d22b1d56f | [
"MIT"
] | 1 | 2019-11-21T15:56:03.000Z | 2019-11-21T15:56:03.000Z | Code/Python2.7/Kattis/08synlists.py | nicholasz2510/General | e2783cad4da7f9b50c952c2b91ef311d22b1d56f | [
"MIT"
] | 12 | 2019-11-21T21:00:57.000Z | 2022-02-27T01:46:56.000Z | Code/Python2.7/Kattis/08synlists.py | nicholasz2510/General | e2783cad4da7f9b50c952c2b91ef311d22b1d56f | [
"MIT"
] | 1 | 2019-11-21T20:49:18.000Z | 2019-11-21T20:49:18.000Z | import sys
shifts = int(sys.stdin[0])
file_ = sys.stdin[1]
overwritten = sys.stdin[2]
checker = []
for icmfcr in shifts:
for i in file_:
if i == "1":
checker.append("0")
elif i == "0":
checker.append("1")
if str(checker) == overwritten:
print "Deletion succeeded"
else:... | 18.368421 | 31 | 0.578797 | import sys
shifts = int(sys.stdin[0])
file_ = sys.stdin[1]
overwritten = sys.stdin[2]
checker = []
for icmfcr in shifts:
for i in file_:
if i == "1":
checker.append("0")
elif i == "0":
checker.append("1")
if str(checker) == overwritten:
print "Deletion succeeded"
else:... | false | true |
f7315e9ebfe36931ca1757fcf4e6d4f8dd4ad184 | 2,810 | py | Python | .history/src/modules/test_plot/test_plot_20190927183934.py | mattzakh/mattplotlib | 5e9bc779d8c1b7074549615ab6790a9f7163cd59 | [
"MIT"
] | null | null | null | .history/src/modules/test_plot/test_plot_20190927183934.py | mattzakh/mattplotlib | 5e9bc779d8c1b7074549615ab6790a9f7163cd59 | [
"MIT"
] | 5 | 2020-03-24T17:44:10.000Z | 2021-08-23T20:22:20.000Z | .history/src/modules/test_plot/test_plot_20190927183934.py | mattzakh/mattplotlib | 5e9bc779d8c1b7074549615ab6790a9f7163cd59 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
# plt.style.use('../notebooks/test.mplstyle')
import seaborn as sns
from logs import logDecorator as lD
import jsonref, pprint
config = jsonref.load(open('../config/config.json'))
logBase = config['logging']['logBase'] + '.modules.test_plot.test_plot'
@lD.log(logB... | 30.543478 | 126 | 0.580071 | import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from logs import logDecorator as lD
import jsonref, pprint
config = jsonref.load(open('../config/config.json'))
logBase = config['logging']['logBase'] + '.modules.test_plot.test_plot'
@lD.log(logBase + '.doSomething')
def doSomething(logger):... | true | true |
f7315faf3403c57b71fcb4aae306f4d130e43b2b | 666 | py | Python | algorithms/python/21.py | scream7/leetcode | 1fe0f5df3ca0019a4d99979cc663993d2492272d | [
"Apache-2.0"
] | null | null | null | algorithms/python/21.py | scream7/leetcode | 1fe0f5df3ca0019a4d99979cc663993d2492272d | [
"Apache-2.0"
] | null | null | null | algorithms/python/21.py | scream7/leetcode | 1fe0f5df3ca0019a4d99979cc663993d2492272d | [
"Apache-2.0"
] | null | null | null | # Definition for singly-linked list.
# class ListNode(object):
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution(object):
def mergeTwoLists(self, l1, l2):
"""
:type l1: ListNode
:type l2: ListNode
:rtype: ListNode
"""
dummy... | 25.615385 | 47 | 0.472973 |
class Solution(object):
def mergeTwoLists(self, l1, l2):
dummy = ListNode(0)
cur = dummy
while l1 and l2:
if l1.val <= l2.val:
cur.next = l1
l1 = l1.next
elif l2.val < l1.val:
cur.next = l2
l2 = l2.next
... | true | true |
f73160aca8239aa3448982a0bb3d29924fd55682 | 4,190 | py | Python | apps/external_apps/django_openid/signed.py | indro/t2c | 56482ad4aed150f29353e054db2c97b567243bf8 | [
"MIT"
] | 3 | 2015-12-25T14:45:36.000Z | 2016-11-28T09:58:03.000Z | apps/external_apps/django_openid/signed.py | indro/t2c | 56482ad4aed150f29353e054db2c97b567243bf8 | [
"MIT"
] | null | null | null | apps/external_apps/django_openid/signed.py | indro/t2c | 56482ad4aed150f29353e054db2c97b567243bf8 | [
"MIT"
] | null | null | null | """
Functions for creating and restoring url-safe signed pickled objects.
The format used looks like this:
>>> signed.dumps("hello")
'UydoZWxsbycKcDAKLg.AfZVu7tE6T1K1AecbLiLOGSqZ-A'
There are two components here, separatad by a '.'. The first component is a
URLsafe base64 encoded pickle of the object passed to dump... | 36.434783 | 83 | 0.699761 | """
Functions for creating and restoring url-safe signed pickled objects.
The format used looks like this:
>>> signed.dumps("hello")
'UydoZWxsbycKcDAKLg.AfZVu7tE6T1K1AecbLiLOGSqZ-A'
There are two components here, separatad by a '.'. The first component is a
URLsafe base64 encoded pickle of the object passed to dump... | false | true |
f7316132008490fabdc6c23eaeae95ebcafde9b9 | 2,856 | py | Python | setup.py | vikrammodh0111/vectorai | 0ca0adf1599639035603af8158477972b0902784 | [
"Apache-2.0"
] | null | null | null | setup.py | vikrammodh0111/vectorai | 0ca0adf1599639035603af8158477972b0902784 | [
"Apache-2.0"
] | null | null | null | setup.py | vikrammodh0111/vectorai | 0ca0adf1599639035603af8158477972b0902784 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
import os
core_req = ["requests", "numpy", "pandas", "appdirs>=1.4.4", "tqdm>=4.27.0", "plotly>=4.0.0"]
extras_req = {
"dev" : ["twine", "black", "pytest", "pytest-cov"],
"test" : ["pytest", "pytest-cov"],
"docs" : [... | 42.626866 | 179 | 0.640056 |
from setuptools import setup, find_packages
import os
core_req = ["requests", "numpy", "pandas", "appdirs>=1.4.4", "tqdm>=4.27.0", "plotly>=4.0.0"]
extras_req = {
"dev" : ["twine", "black", "pytest", "pytest-cov"],
"test" : ["pytest", "pytest-cov"],
"docs" : ["sphinx-rtd-theme>=0.5.0", "nbsphinx>=0.7.1"]
... | true | true |
f7316151b54b3cb3affdbe30c1d0eafb1b8f3f72 | 23,981 | py | Python | scripts/casava_data_delivery.py | ssjunnebo/scilifelab | 79960f7042118f900bd1eaabe4902ee76abd8020 | [
"MIT"
] | 1 | 2016-03-21T14:04:09.000Z | 2016-03-21T14:04:09.000Z | scripts/casava_data_delivery.py | ssjunnebo/scilifelab | 79960f7042118f900bd1eaabe4902ee76abd8020 | [
"MIT"
] | 35 | 2015-01-22T08:25:02.000Z | 2020-02-17T12:09:12.000Z | scripts/casava_data_delivery.py | ssjunnebo/scilifelab | 79960f7042118f900bd1eaabe4902ee76abd8020 | [
"MIT"
] | 6 | 2015-01-16T15:32:08.000Z | 2020-01-30T14:34:40.000Z | # A script to help doing the deliveries.
# Now using the Casava directory structure
# The user is asked to provide a project ID, a run name, and an UPPMAX project
import sys
import os
import glob
import re
import grp
from datetime import datetime
import argparse
import stat
from subprocess import check_call, CalledPro... | 46.206166 | 155 | 0.517285 |
import sys
import os
import glob
import re
import grp
from datetime import datetime
import argparse
import stat
from subprocess import check_call, CalledProcessError
from scilifelab.utils.misc import filtered_walk, query_yes_no, touch_file
from scilifelab.utils.timestamp import utc_time
def fixProjName(pname):
ne... | false | true |
f7316298bcfb66abd224d102bd05d708bceccc59 | 647 | py | Python | SAMparser.py | camaclean/bella | c80c012cda05bc15b69db7fd54424823f75b5a21 | [
"BSD-3-Clause-LBNL"
] | 36 | 2018-11-07T14:21:20.000Z | 2020-07-21T03:52:20.000Z | SAMparser.py | camaclean/bella | c80c012cda05bc15b69db7fd54424823f75b5a21 | [
"BSD-3-Clause-LBNL"
] | 5 | 2018-11-09T11:03:36.000Z | 2019-09-10T18:39:39.000Z | SAMparser.py | camaclean/bella | c80c012cda05bc15b69db7fd54424823f75b5a21 | [
"BSD-3-Clause-LBNL"
] | 6 | 2019-05-21T01:15:02.000Z | 2020-06-17T16:34:36.000Z | from simplesam import Reader, Writer
import inspect
import sys, os, fileinput, string
in_file = open(sys.argv[1], 'r')
in_sam = Reader(in_file)
out_file = open('full_ecoli_mapped_q10_truth.txt', 'w')
# out_sam = Writer(out_file)
x = next(in_sam)
try:
while(x.qname != ''):
#if(x.reverse):
# out_file.write("+" + ... | 23.107143 | 55 | 0.650696 | from simplesam import Reader, Writer
import inspect
import sys, os, fileinput, string
in_file = open(sys.argv[1], 'r')
in_sam = Reader(in_file)
out_file = open('full_ecoli_mapped_q10_truth.txt', 'w')
x = next(in_sam)
try:
while(x.qname != ''):
out_file.write(x.rname + " ")
out_file.write(x.qname + " ")
... | true | true |
f73162a75addcf3c375f9aa1bcc038bdb5b9598e | 16,255 | py | Python | XBNet/main.py | tusharsarkar3/XBNet | 01e385f1c0a446eb38f4dd59ee9c510170bf096b | [
"MIT"
] | 167 | 2021-06-03T18:45:12.000Z | 2022-03-30T10:50:35.000Z | XBNet/main.py | tusharsarkar3/XBNet | 01e385f1c0a446eb38f4dd59ee9c510170bf096b | [
"MIT"
] | 13 | 2021-06-12T04:11:16.000Z | 2022-03-18T15:56:36.000Z | XBNet/main.py | tusharsarkar3/XBNet | 01e385f1c0a446eb38f4dd59ee9c510170bf096b | [
"MIT"
] | 27 | 2021-06-11T08:44:05.000Z | 2022-02-26T11:54:43.000Z | from kivymd.app import MDApp
from kivy.uix.widget import Widget
from kivy.uix.actionbar import ActionBar
from kivy.uix.scrollview import ScrollView
from kivy.uix.boxlayout import BoxLayout
from kivymd.theming import ThemableBehavior
from kivymd.uix.list import OneLineListItem, MDList, TwoLineListItem, ThreeLineListItem... | 40.235149 | 150 | 0.562781 | from kivymd.app import MDApp
from kivy.uix.widget import Widget
from kivy.uix.actionbar import ActionBar
from kivy.uix.scrollview import ScrollView
from kivy.uix.boxlayout import BoxLayout
from kivymd.theming import ThemableBehavior
from kivymd.uix.list import OneLineListItem, MDList, TwoLineListItem, ThreeLineListItem... | true | true |
f7316351492d58d868c0577a2c53428d4e7bd48c | 815 | py | Python | apiapp/views.py | cansati/api-project | 9760025d84e91997ee9d3e141263e903ec95d6df | [
"MIT"
] | null | null | null | apiapp/views.py | cansati/api-project | 9760025d84e91997ee9d3e141263e903ec95d6df | [
"MIT"
] | null | null | null | apiapp/views.py | cansati/api-project | 9760025d84e91997ee9d3e141263e903ec95d6df | [
"MIT"
] | null | null | null | from rest_framework import viewsets
from . import serializers, models, permissions
from rest_framework.authentication import TokenAuthentication
from rest_framework.permissions import IsAuthenticated
from rest_framework import filters
from rest_framework.authtoken.views import ObtainAuthToken
from rest_framework.settin... | 42.894737 | 72 | 0.825767 | from rest_framework import viewsets
from . import serializers, models, permissions
from rest_framework.authentication import TokenAuthentication
from rest_framework.permissions import IsAuthenticated
from rest_framework import filters
from rest_framework.authtoken.views import ObtainAuthToken
from rest_framework.settin... | true | true |
f73163bebf2ce9fdff591feac06da38b26c56b96 | 851 | py | Python | ooobuild/dyn/sdb/definition_content.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/dyn/sdb/definition_content.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/dyn/sdb/definition_content.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http: // www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 32.730769 | 79 | 0.760282 |
from ...lo.sdb.definition_content import DefinitionContent as DefinitionContent
__all__ = ['DefinitionContent']
| true | true |
f731655548ca300269d3b7f542881d9a8eb93c2a | 4,830 | py | Python | src/pykeen/models/unimodal/trans_e.py | DJRavinszkha/pykeen | d79fe39f83bc2831137f22be6421b37568694cf4 | [
"MIT"
] | null | null | null | src/pykeen/models/unimodal/trans_e.py | DJRavinszkha/pykeen | d79fe39f83bc2831137f22be6421b37568694cf4 | [
"MIT"
] | null | null | null | src/pykeen/models/unimodal/trans_e.py | DJRavinszkha/pykeen | d79fe39f83bc2831137f22be6421b37568694cf4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""TransE."""
from typing import Any, ClassVar, Mapping, Optional
import torch
import torch.autograd
from torch.nn import functional
from ..base import EntityRelationEmbeddingModel
from ...constants import DEFAULT_EMBEDDING_HPO_EMBEDDING_DIM_RANGE
from ...losses import Loss
from ...nn.emb im... | 38.951613 | 119 | 0.654658 |
from typing import Any, ClassVar, Mapping, Optional
import torch
import torch.autograd
from torch.nn import functional
from ..base import EntityRelationEmbeddingModel
from ...constants import DEFAULT_EMBEDDING_HPO_EMBEDDING_DIM_RANGE
from ...losses import Loss
from ...nn.emb import EmbeddingSpecification
from ...nn... | true | true |
f73165f0c8a4ee6043789cf0356dafa3edf3bfa8 | 1,392 | py | Python | main.py | tejasvicsr1/Jumble-Solver | 12980394f6f0b7a5a580a56389559266f3825d6a | [
"MIT"
] | null | null | null | main.py | tejasvicsr1/Jumble-Solver | 12980394f6f0b7a5a580a56389559266f3825d6a | [
"MIT"
] | null | null | null | main.py | tejasvicsr1/Jumble-Solver | 12980394f6f0b7a5a580a56389559266f3825d6a | [
"MIT"
] | null | null | null | # Python code to unscramble a jumbled word using the Enchant dictionary(US) and itertools in Python.
from itertools import permutations
import enchant
word_list = enchant.Dict("en_US")
# Taking the input word and converting it into lowercase words.
word = input("Enter the letters: ")
word = word.lower()
word_length ... | 28.408163 | 101 | 0.655891 | from itertools import permutations
import enchant
word_list = enchant.Dict("en_US")
word = input("Enter the letters: ")
word = word.lower()
word_length = len(word)
def output_fnc(length):
temp = []
for word in ans:
if len(word) == length:
temp.append(word)
if len(temp) != 0:
pr... | true | true |
f731664d01602fc4bc98d2d3a1dca73625c63b84 | 14,176 | py | Python | file-access/static/usr/bin/setup-users-and-groups.py | aisbergg/dockerfiles | 3cf24d2667a75d6eda8b8fb7df835b97c6a13348 | [
"MIT"
] | 1 | 2019-10-23T06:54:06.000Z | 2019-10-23T06:54:06.000Z | file-access/static/usr/bin/setup-users-and-groups.py | aisbergg/dockerfiles | 3cf24d2667a75d6eda8b8fb7df835b97c6a13348 | [
"MIT"
] | null | null | null | file-access/static/usr/bin/setup-users-and-groups.py | aisbergg/dockerfiles | 3cf24d2667a75d6eda8b8fb7df835b97c6a13348 | [
"MIT"
] | null | null | null | import argparse
import crypt
import json
import os
import pwd
import random
import re
import string
import subprocess
import sys
import traceback
from itertools import product
import yaml
class ACL:
@staticmethod
def get_file_acl(path):
if not os.path.exists(path):
raise IOError("The dir... | 46.175896 | 236 | 0.55862 | import argparse
import crypt
import json
import os
import pwd
import random
import re
import string
import subprocess
import sys
import traceback
from itertools import product
import yaml
class ACL:
@staticmethod
def get_file_acl(path):
if not os.path.exists(path):
raise IOError("The dir... | true | true |
f73167cc38566b53bef2f4ba63993e95af6bb2c0 | 3,587 | py | Python | brian2/only.py | awillats/brian2 | e1107ed0cc4a7d6c69c1e2634b675ba09edfd9fc | [
"BSD-2-Clause"
] | 1 | 2021-06-10T15:28:51.000Z | 2021-06-10T15:28:51.000Z | brian2/only.py | awillats/brian2 | e1107ed0cc4a7d6c69c1e2634b675ba09edfd9fc | [
"BSD-2-Clause"
] | null | null | null | brian2/only.py | awillats/brian2 | e1107ed0cc4a7d6c69c1e2634b675ba09edfd9fc | [
"BSD-2-Clause"
] | null | null | null | '''
A dummy package to allow wildcard import from brian2 without also importing
the pylab (numpy + matplotlib) namespace.
Usage: ``from brian2.only import *``
'''
# To minimize the problems with imports, import the packages in a sensible
# order
# The units and utils package does not depend on any other Brian packag... | 31.191304 | 85 | 0.726234 |
from brian2.units import *
from brian2.utils import *
from brian2.core.tracking import *
from brian2.core.names import *
from brian2.core.spikesource import *
from brian2.core.variables import linked_var
from brian2.core.functions import *
from brian2.core.preferences import *
from brian2.core.clocks import *
from b... | true | true |
f73168e6d9bed2cc8b08603295293be0c8f914d9 | 5,134 | py | Python | test/test_keytool_parse.py | cccs-rs/assemblyline-v4-service | ed53dedaa6f3c4e3850defd9f68b0d57407153bf | [
"MIT"
] | 6 | 2020-06-30T13:54:44.000Z | 2021-05-28T19:36:32.000Z | test/test_keytool_parse.py | cccs-rs/assemblyline-v4-service | ed53dedaa6f3c4e3850defd9f68b0d57407153bf | [
"MIT"
] | 17 | 2020-06-19T03:02:21.000Z | 2022-03-01T18:19:07.000Z | test/test_keytool_parse.py | cccs-rs/assemblyline-v4-service | ed53dedaa6f3c4e3850defd9f68b0d57407153bf | [
"MIT"
] | 8 | 2020-04-30T16:11:52.000Z | 2021-07-16T12:11:40.000Z | import pytest
class TestKeytoolParse:
@staticmethod
@pytest.mark.parametrize("printcert, correct_certs",
[
('Owner: CN=ca, OU=ca, O=ca, L=ca, ST=ca, C=CA\nIssuer: CN=root, OU=root, O=root, L=root, ST=root, C=CA\nSerial number: 5f822698\nValid from: Wed Apr 14 13:40:13 EDT 2021 until: Tue ... | 190.148148 | 2,706 | 0.639462 | import pytest
class TestKeytoolParse:
@staticmethod
@pytest.mark.parametrize("printcert, correct_certs",
[
('Owner: CN=ca, OU=ca, O=ca, L=ca, ST=ca, C=CA\nIssuer: CN=root, OU=root, O=root, L=root, ST=root, C=CA\nSerial number: 5f822698\nValid from: Wed Apr 14 13:40:13 EDT 2021 until: Tue ... | true | true |
f7316970b0437dcd982b168d5fcd16d064c8cb16 | 8,044 | py | Python | tempest/api/identity/admin/v3/test_domain_configuration.py | mail2nsrajesh/tempest | 1a3b3dc50b418d3a15839830d7d1ff88c8c76cff | [
"Apache-2.0"
] | null | null | null | tempest/api/identity/admin/v3/test_domain_configuration.py | mail2nsrajesh/tempest | 1a3b3dc50b418d3a15839830d7d1ff88c8c76cff | [
"Apache-2.0"
] | null | null | null | tempest/api/identity/admin/v3/test_domain_configuration.py | mail2nsrajesh/tempest | 1a3b3dc50b418d3a15839830d7d1ff88c8c76cff | [
"Apache-2.0"
] | 5 | 2016-06-24T20:03:52.000Z | 2020-02-05T10:14:54.000Z | # Copyright 2017 AT&T Corporation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | 43.481081 | 79 | 0.669443 |
from tempest.api.identity import base
from tempest.lib.common.utils import data_utils
from tempest.lib.common.utils import test_utils
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
class DomainConfigurationTestJSON(base.BaseIdentityV3AdminTest):
custom_config = {
"ident... | true | true |
f731698f7c8a52b2ad20a1732001853d221b636d | 9,161 | py | Python | metalibm_core/code_generation/code_function.py | metalibm/metalibm-clone | d04839e58950a156b79b763b9f45cb874e21ebfe | [
"MIT"
] | null | null | null | metalibm_core/code_generation/code_function.py | metalibm/metalibm-clone | d04839e58950a156b79b763b9f45cb874e21ebfe | [
"MIT"
] | null | null | null | metalibm_core/code_generation/code_function.py | metalibm/metalibm-clone | d04839e58950a156b79b763b9f45cb874e21ebfe | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
###############################################################################
# This file is part of metalibm (https://github.com/kalray/metalibm)
###############################################################################
# MIT License
#
# Copyright (c) 2018 Kalray
#
# Permission is here... | 41.640909 | 145 | 0.709966 |
from ..core.ml_operations import Variable, FunctionObject, FunctionType
from .code_object import NestedCode
from .generator_utility import FunctionOperator, FO_Arg
from .code_constant import *
class CodeFunction(object):
def __init__(self, name, arg_list=None, output_format=None, code_object=None, language=C_Code... | true | true |
f7316a0076d2b4bf5804f2d9d837fa670e1f56a2 | 5,487 | py | Python | classic_tetris_project_django/settings.py | professor-l/classic-tetris-project | d171ab40c06b87ee945dce058babf2ed23dd3b88 | [
"MIT"
] | 17 | 2019-11-23T12:56:06.000Z | 2022-02-05T21:48:00.000Z | classic_tetris_project_django/settings.py | professor-l/classic-tetris-project | d171ab40c06b87ee945dce058babf2ed23dd3b88 | [
"MIT"
] | 43 | 2019-10-03T20:16:11.000Z | 2022-03-12T00:24:52.000Z | classic_tetris_project_django/settings.py | professor-l/classic-tetris-project | d171ab40c06b87ee945dce058babf2ed23dd3b88 | [
"MIT"
] | 17 | 2020-02-09T01:55:01.000Z | 2021-11-12T21:16:50.000Z | """
Django settings for classic_tetris_project_django 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/setti... | 26.253589 | 91 | 0.67906 |
import environ
import django
import os
ENV = environ.Env(
SECRET_KEY=(str, 'd0$j=wune9kn70srt1lt!g3a8fim7ug#j@x8+zmy0gi_mv7&dk'),
DEBUG=(bool, True),
DATABASE_URL=(str, 'sqlite:///db.sqlite3'),
CACHE_URL=(str, 'rediscache://'),
BASE_URL=(str, 'http://dev.monthlytetris.info:8000'),
DISCORD_USER... | true | true |
f7316a594c1c8ddc04649d2c3866818979f193b5 | 12,132 | py | Python | python/modprop/core/modules_core.py | Humhu/modprop | 0cff8240d5e1522f620de8004c22a74491a0c9fb | [
"AFL-3.0"
] | 1 | 2017-11-10T00:54:53.000Z | 2017-11-10T00:54:53.000Z | python/modprop/core/modules_core.py | Humhu/modprop | 0cff8240d5e1522f620de8004c22a74491a0c9fb | [
"AFL-3.0"
] | null | null | null | python/modprop/core/modules_core.py | Humhu/modprop | 0cff8240d5e1522f620de8004c22a74491a0c9fb | [
"AFL-3.0"
] | null | null | null | """This module contains base classes and types for creating new Modules and using module trees.
"""
import abc
from collections import deque
import numpy as np
class ModuleBase(object):
"""The base interface for all modules. Modules must inherit from this interface.
"""
__metaclass__ = abc.ABCMeta
def... | 28.817102 | 104 | 0.60089 | import abc
from collections import deque
import numpy as np
class ModuleBase(object):
__metaclass__ = abc.ABCMeta
def __init__(self):
self._inputs = []
self._outputs = []
def register_inputs(self, *args):
for arg in args:
if not isinstance(arg, InputPort):
... | true | true |
f7316ace9299b1066e1b315ba165fdf6fd372280 | 1,042 | py | Python | recipes/mojo.py | azunite/chrome_build | fed8b4e9c12aa9a0e33680e223b6327a65b2c268 | [
"BSD-3-Clause"
] | 10 | 2016-06-15T06:27:53.000Z | 2019-08-29T05:44:28.000Z | recipes/mojo.py | azunite/chrome_build | fed8b4e9c12aa9a0e33680e223b6327a65b2c268 | [
"BSD-3-Clause"
] | null | null | null | recipes/mojo.py | azunite/chrome_build | fed8b4e9c12aa9a0e33680e223b6327a65b2c268 | [
"BSD-3-Clause"
] | 19 | 2016-03-25T08:12:35.000Z | 2022-02-14T06:05:26.000Z | # Copyright 2014 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.
import sys
import recipe_util # pylint: disable=F0401
# This class doesn't need an __init__ method, so we disable the warning
# pylint: disable=W0232
cla... | 22.170213 | 72 | 0.627639 |
import sys
import recipe_util
# pylint: disable=W0232
class Mojo(recipe_util.Recipe):
@staticmethod
def fetch_spec(props):
url = 'https://github.com/domokit/mojo.git'
solution = {
'name' :'src',
'url' : url,
'deps_file': 'DEPS',
'managed' : False,
'custom_deps': {}... | true | true |
f7316bd69a4ba467eed53268684ee4aaaa448a25 | 2,259 | py | Python | mmaction/models/builder.py | jiaoml1996/mmaction2 | cff4a9e196dfc7b7b0e842ab44f2a7f2573a2c7c | [
"Apache-2.0"
] | 1 | 2021-01-07T05:03:16.000Z | 2021-01-07T05:03:16.000Z | mmaction/models/builder.py | xumingze0308/mmaction2 | 777546f27f8f5a3c83e10d966e2149be2fc9fa31 | [
"Apache-2.0"
] | null | null | null | mmaction/models/builder.py | xumingze0308/mmaction2 | 777546f27f8f5a3c83e10d966e2149be2fc9fa31 | [
"Apache-2.0"
] | null | null | null | import warnings
import torch.nn as nn
from mmcv.utils import Registry, build_from_cfg
from .registry import BACKBONES, HEADS, LOCALIZERS, LOSSES, NECKS, RECOGNIZERS
try:
from mmdet.models.builder import DETECTORS, build_detector
except (ImportError, ModuleNotFoundError):
warnings.warn('Please install mmdet t... | 26.267442 | 78 | 0.666224 | import warnings
import torch.nn as nn
from mmcv.utils import Registry, build_from_cfg
from .registry import BACKBONES, HEADS, LOCALIZERS, LOSSES, NECKS, RECOGNIZERS
try:
from mmdet.models.builder import DETECTORS, build_detector
except (ImportError, ModuleNotFoundError):
warnings.warn('Please install mmdet t... | true | true |
f7316c5bc4aa4105269362035d277cc55ecd7b85 | 3,975 | py | Python | MyResumes/MyResumes/MyResumes/settings.py | githubError/MessyRepository | 2380ed13c167c5c6174f0e71c8dfc634318cda4f | [
"MIT"
] | 2 | 2018-03-12T08:01:47.000Z | 2018-03-12T08:06:14.000Z | MyResumes/MyResumes/MyResumes/settings.py | githubError/MessyRepository | 2380ed13c167c5c6174f0e71c8dfc634318cda4f | [
"MIT"
] | null | null | null | MyResumes/MyResumes/MyResumes/settings.py | githubError/MessyRepository | 2380ed13c167c5c6174f0e71c8dfc634318cda4f | [
"MIT"
] | 1 | 2019-11-06T15:58:05.000Z | 2019-11-06T15:58:05.000Z | """
Django settings for MyResumes project.
Generated by 'django-admin startproject' using Django 2.0.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.0/ref/settings/
"""
import os
... | 25 | 91 | 0.683522 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'lqpjra6xa@pm96&$y1xri(uau#vk2&)7b1hi6$k&v=zvne*o)%'
DEBUG = True
ALLOWED_HOSTS = ['*']
# Application definition
INSTALLED_APPS = [
'Resumes.apps.ResumesConfig',
'django.contrib.admin',
'django.contrib.au... | true | true |
f7316c7ddaccd1a7c79dfb5e3ac9e15377fd1b26 | 4,228 | py | Python | test_tile/test_tile_magma.py | zbelateche/ee272_cgra | 4cf2e3cf4a4bdf585d87a9209a5bf252666bc6a2 | [
"BSD-3-Clause"
] | 1 | 2020-07-23T02:57:12.000Z | 2020-07-23T02:57:12.000Z | test_tile/test_tile_magma.py | zbelateche/ee272_cgra | 4cf2e3cf4a4bdf585d87a9209a5bf252666bc6a2 | [
"BSD-3-Clause"
] | null | null | null | test_tile/test_tile_magma.py | zbelateche/ee272_cgra | 4cf2e3cf4a4bdf585d87a9209a5bf252666bc6a2 | [
"BSD-3-Clause"
] | 1 | 2021-04-27T23:13:43.000Z | 2021-04-27T23:13:43.000Z | from common.dummy_core_magma import DummyCore
from bit_vector import BitVector
from tile.tile_magma import Tile
from common.testers import BasicTester
import tempfile
from fault.random import random_bv
def check_all_config(tester,
tile_circ,
tile,
data_wr... | 38.436364 | 79 | 0.602176 | from common.dummy_core_magma import DummyCore
from bit_vector import BitVector
from tile.tile_magma import Tile
from common.testers import BasicTester
import tempfile
from fault.random import random_bv
def check_all_config(tester,
tile_circ,
tile,
data_wr... | true | true |
f7316cf7b3b3e6fbabab8a174cf2ecb75444019b | 4,820 | py | Python | docs/conf.py | aladinoster/prjits_01_v2i | b6b3f96899d56c583c87098ea53ef008a8cb4365 | [
"MIT"
] | null | null | null | docs/conf.py | aladinoster/prjits_01_v2i | b6b3f96899d56c583c87098ea53ef008a8cb4365 | [
"MIT"
] | null | null | null | docs/conf.py | aladinoster/prjits_01_v2i | b6b3f96899d56c583c87098ea53ef008a8cb4365 | [
"MIT"
] | 1 | 2020-10-20T09:37:48.000Z | 2020-10-20T09:37:48.000Z | #!/usr/bin/env python
#
# connectv2x documentation build configuration file, created by
# sphinx-quickstart on Fri Jun 9 13:47:02 2017.
#
# 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.
#
# ... | 29.570552 | 77 | 0.686722 |
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
import connectv2x
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = 'connectv2x'
copyright = "2019, Andres Ladino"
author = "Andres Ladino"
# for |versi... | true | true |
f7316dfaeb40184095a7f7a53a6f4baaf2fb85dd | 4,081 | py | Python | vcx/wrappers/python3/tests/test_wallet.py | absltkaos/indy-sdk | bc14c5b514dc1c76ce62dd7f6bf804120bf69f5e | [
"Apache-2.0"
] | 5 | 2018-04-09T12:26:28.000Z | 2019-06-12T01:45:30.000Z | vcx/wrappers/python3/tests/test_wallet.py | absltkaos/indy-sdk | bc14c5b514dc1c76ce62dd7f6bf804120bf69f5e | [
"Apache-2.0"
] | 9 | 2019-01-22T22:31:54.000Z | 2019-04-11T21:45:09.000Z | vcx/wrappers/python3/tests/test_wallet.py | absltkaos/indy-sdk | bc14c5b514dc1c76ce62dd7f6bf804120bf69f5e | [
"Apache-2.0"
] | 19 | 2018-04-25T16:08:43.000Z | 2022-01-11T10:18:38.000Z | import pytest
from vcx.error import VcxError, ErrorCode
from vcx.api.wallet import *
import json
TYPE = "record type"
EMPTY_TYPE = ""
ID = "123"
EMPTY_ID = ""
VALUE = "record value"
VALUE_NEW = "RecordValueNew"
EMPTY_VALUE = ""
TAGS = "{\"tagName1\":\"str1\",\"tagName2\":\"5\",\"tagName3\":\"12\"}"
OPTIONS = json.dump... | 31.392308 | 96 | 0.708895 | import pytest
from vcx.error import VcxError, ErrorCode
from vcx.api.wallet import *
import json
TYPE = "record type"
EMPTY_TYPE = ""
ID = "123"
EMPTY_ID = ""
VALUE = "record value"
VALUE_NEW = "RecordValueNew"
EMPTY_VALUE = ""
TAGS = "{\"tagName1\":\"str1\",\"tagName2\":\"5\",\"tagName3\":\"12\"}"
OPTIONS = json.dump... | true | true |
f73170c66a28ee836b140a20bd40414c0d6d7122 | 13,527 | py | Python | micropsi_server/usermanagement.py | joschabach/micropsi2 | 74a2642d20da9da1d64acc5e4c11aeabee192a27 | [
"MIT"
] | 119 | 2015-01-23T11:24:58.000Z | 2022-03-13T08:00:50.000Z | micropsi_server/usermanagement.py | Chediak/micropsi2 | 74a2642d20da9da1d64acc5e4c11aeabee192a27 | [
"MIT"
] | 9 | 2015-02-18T20:44:58.000Z | 2021-09-17T14:38:05.000Z | micropsi_server/usermanagement.py | Chediak/micropsi2 | 74a2642d20da9da1d64acc5e4c11aeabee192a27 | [
"MIT"
] | 34 | 2015-04-01T20:48:49.000Z | 2022-03-13T08:02:00.000Z | """
Very simple user management for the MicroPsi service
The user manager takes care of users, sessions and user roles.
Users without a password set can login with an arbitrary password, so make sure that users do not set empty passwords
if this concerns you.
When new users are created, they are given a role and stor... | 42.537736 | 122 | 0.645524 |
__author__ = 'joscha'
__date__ = '11.05.12'
import json
import hashlib
import os
import datetime
import threading
import time
import uuid
import logging
import micropsi_core.tools
from configuration import config as cfg
ADMIN_USER = "admin" DEFAULT_ROLE = "Restricted" IDLE_TIME_BEFORE_SESSION_EXPIRES = 360000 TIM... | true | true |
f731716e66ce6ce28fd803a90df2d90dd154013a | 1,402 | py | Python | iop_data_flow/footfall/01_footfall_clip.py | IaaC/MACT21.22_Digital_tools_Big_Data_part_2 | f0c50a5f7ac147f6e9753545767d2d9998075ebb | [
"Apache-2.0"
] | 1 | 2022-02-18T14:35:34.000Z | 2022-02-18T14:35:34.000Z | iop_data_flow/footfall/01_footfall_clip.py | IaaC/MACT21.22_Digital_tools_Big_Data_part_2 | f0c50a5f7ac147f6e9753545767d2d9998075ebb | [
"Apache-2.0"
] | null | null | null | iop_data_flow/footfall/01_footfall_clip.py | IaaC/MACT21.22_Digital_tools_Big_Data_part_2 | f0c50a5f7ac147f6e9753545767d2d9998075ebb | [
"Apache-2.0"
] | 1 | 2022-02-18T14:35:40.000Z | 2022-02-18T14:35:40.000Z | import os
import pandas as pd
import geopandas as gpd
## Config
# Number of rows to read
nrows = 1000
#nrows = 1000000
#nrows = None
# Output file path
day_num = 1
input_csv_filepath = f'../../data/footfall/footfall_20210217/day{day_num}Bcntrakingotherdays.csv'
# Clip mask file path
#clip_mask_filepath = '../../da... | 26.961538 | 99 | 0.736091 | import os
import pandas as pd
import geopandas as gpd
nrows = 1000
day_num = 1
input_csv_filepath = f'../../data/footfall/footfall_20210217/day{day_num}Bcntrakingotherdays.csv'
clip_mask_filepath = '../../data/footfall/aoi_glories.geojson'
output_file = f'ff-day{day_num}-clipped.shp'
output_folder = '../../data/s... | true | true |
f731716eb335aa711c9fca62072e00fad94f8a35 | 4,633 | py | Python | sis-api/swagger_server/models/address.py | maxbilbow/7054CEM-sis | 1c5067c9afc38e340fcce046048f8ae21d267365 | [
"MIT"
] | null | null | null | sis-api/swagger_server/models/address.py | maxbilbow/7054CEM-sis | 1c5067c9afc38e340fcce046048f8ae21d267365 | [
"MIT"
] | null | null | null | sis-api/swagger_server/models/address.py | maxbilbow/7054CEM-sis | 1c5067c9afc38e340fcce046048f8ae21d267365 | [
"MIT"
] | null | null | null | # coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from swagger_server.models.base_model_ import Model
from swagger_server import util
class Address(Model):
"""NOTE: This class is auto generated by the swagger cod... | 24.005181 | 149 | 0.564429 |
from __future__ import absolute_import
from datetime import date, datetime
from typing import List, Dict
from swagger_server.models.base_model_ import Model
from swagger_server import util
class Address(Model):
def __init__(self, id: int=None, number_or_name: str=None, street: str=None, town: str=None, count... | true | true |
f73171a82a9e8efd02676c00bb3724b2c05b4702 | 673 | py | Python | atlasbrief/mainsite/migrations/0002_auto_20180124_1611.py | joshr2020/Atlas-Brief | 4471102a7a4b5bf549ef044d7d7de939438011dd | [
"MIT"
] | 1 | 2018-08-20T19:02:00.000Z | 2018-08-20T19:02:00.000Z | atlasbrief/mainsite/migrations/0002_auto_20180124_1611.py | joshr2020/Atlas-Brief | 4471102a7a4b5bf549ef044d7d7de939438011dd | [
"MIT"
] | null | null | null | atlasbrief/mainsite/migrations/0002_auto_20180124_1611.py | joshr2020/Atlas-Brief | 4471102a7a4b5bf549ef044d7d7de939438011dd | [
"MIT"
] | null | null | null | # Generated by Django 2.0.1 on 2018-01-24 21:11
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('mainsite', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='brief',
... | 24.035714 | 117 | 0.576523 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('mainsite', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='brief',
name='sources',
),
migrati... | true | true |
f73172073a5b7aa03cf878398739be9ce4b17eb0 | 9,088 | py | Python | src/ploomber/io/_commander.py | aadityasinha-dotcom/ploomber | ddbdb63bf7e92d4c48073893b5f54a5f59383291 | [
"Apache-2.0"
] | null | null | null | src/ploomber/io/_commander.py | aadityasinha-dotcom/ploomber | ddbdb63bf7e92d4c48073893b5f54a5f59383291 | [
"Apache-2.0"
] | null | null | null | src/ploomber/io/_commander.py | aadityasinha-dotcom/ploomber | ddbdb63bf7e92d4c48073893b5f54a5f59383291 | [
"Apache-2.0"
] | null | null | null | import os
import sys
import subprocess
import shutil
from pathlib import Path, PurePosixPath
from click import ClickException
from jinja2 import Environment, PackageLoader, StrictUndefined
from ploomber.io import TerminalWriter
def to_pascal_case(name):
return ''.join([w.capitalize() for w in name.split('_')])
... | 28.4 | 79 | 0.554027 | import os
import sys
import subprocess
import shutil
from pathlib import Path, PurePosixPath
from click import ClickException
from jinja2 import Environment, PackageLoader, StrictUndefined
from ploomber.io import TerminalWriter
def to_pascal_case(name):
return ''.join([w.capitalize() for w in name.split('_')])
... | true | true |
f73172862b0577c542d1d19db00a7e6b31dc2af6 | 101 | py | Python | python/scope/scope-3.py | trammell/test | ccac5e1dac947032e64d813e53cb961417a58d05 | [
"Artistic-2.0"
] | null | null | null | python/scope/scope-3.py | trammell/test | ccac5e1dac947032e64d813e53cb961417a58d05 | [
"Artistic-2.0"
] | null | null | null | python/scope/scope-3.py | trammell/test | ccac5e1dac947032e64d813e53cb961417a58d05 | [
"Artistic-2.0"
] | null | null | null | #!/usr/bin/env python2.4
# Example 3
i = 1
def h():
print i
i = 2
print i
h()
print i
| 7.769231 | 24 | 0.514851 |
i = 1
def h():
print i
i = 2
print i
h()
print i
| false | true |
f73173b0bf6552c411247cc25c457802bd9b31e5 | 15,273 | py | Python | zerogercrnn/experiments/ast_level/metrics.py | zerogerc/rnn-autocomplete | 39dc8dd7c431cb8ac9e15016388ec823771388e4 | [
"Apache-2.0"
] | 7 | 2019-02-27T09:48:39.000Z | 2021-11-30T19:01:01.000Z | zerogercrnn/experiments/ast_level/metrics.py | ZeRoGerc/rnn-autocomplete | 39dc8dd7c431cb8ac9e15016388ec823771388e4 | [
"Apache-2.0"
] | null | null | null | zerogercrnn/experiments/ast_level/metrics.py | ZeRoGerc/rnn-autocomplete | 39dc8dd7c431cb8ac9e15016388ec823771388e4 | [
"Apache-2.0"
] | null | null | null | import json
import os
import numpy as np
import torch
from zerogercrnn.lib.constants import EMPTY_TOKEN_ID, UNKNOWN_TOKEN_ID
from zerogercrnn.experiments.ast_level.utils import read_non_terminals
from zerogercrnn.lib.constants import EMPTY_TOKEN_ID, UNKNOWN_TOKEN_ID, EOF_TOKEN
from zerogercrnn.lib.metrics import Metr... | 38.568182 | 142 | 0.659726 | import json
import os
import numpy as np
import torch
from zerogercrnn.lib.constants import EMPTY_TOKEN_ID, UNKNOWN_TOKEN_ID
from zerogercrnn.experiments.ast_level.utils import read_non_terminals
from zerogercrnn.lib.constants import EMPTY_TOKEN_ID, UNKNOWN_TOKEN_ID, EOF_TOKEN
from zerogercrnn.lib.metrics import Metr... | true | true |
f731744360c85355f37d6f3b7a8789da418a6261 | 544 | py | Python | LeetCode/Algorithms/Easy/PascalsTriangle/PascalsTriangle.py | roshan11160/Competitive-Programming-Solutions | 2d9cfe901c23a2b7344c410b7368eb02f7fa6e7e | [
"MIT"
] | 40 | 2020-07-25T19:35:37.000Z | 2022-01-28T02:57:02.000Z | LeetCode/Algorithms/Easy/PascalsTriangle/PascalsTriangle.py | afrozchakure/Hackerrank-Problem-Solutions | 014155d841e08cb1f7609c23335576dc9b29cef3 | [
"MIT"
] | 34 | 2020-10-10T17:59:46.000Z | 2021-10-05T18:29:25.000Z | LeetCode/Algorithms/Easy/PascalsTriangle/PascalsTriangle.py | afrozchakure/Hackerrank-Problem-Solutions | 014155d841e08cb1f7609c23335576dc9b29cef3 | [
"MIT"
] | 24 | 2020-05-03T08:11:53.000Z | 2021-10-04T03:23:20.000Z | class Solution:
def generate(self, numRows: int) -> List[List[int]]:
result = [[1]]
for i in range(1, numRows):
temp1 = result[-1] + [0]
temp2 = [0] + result[-1]
result.append([temp1[i] + temp2[i] for i in range(len(temp1))])
return result[:numRows]
... | 25.904762 | 90 | 0.523897 | class Solution:
def generate(self, numRows: int) -> List[List[int]]:
result = [[1]]
for i in range(1, numRows):
temp1 = result[-1] + [0]
temp2 = [0] + result[-1]
result.append([temp1[i] + temp2[i] for i in range(len(temp1))])
return result[:numRows]
... | true | true |
f7317480ca6a2ca583ccb6170587b803d919d1a4 | 2,591 | py | Python | framework/auth/decorators.py | alexschiller/osf.io | 4122d4be152c6189142c2ebb19cfdee09c77035d | [
"Apache-2.0"
] | null | null | null | framework/auth/decorators.py | alexschiller/osf.io | 4122d4be152c6189142c2ebb19cfdee09c77035d | [
"Apache-2.0"
] | null | null | null | framework/auth/decorators.py | alexschiller/osf.io | 4122d4be152c6189142c2ebb19cfdee09c77035d | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import time
import httplib
import functools
from flask import request
from framework.auth import cas
from framework.auth import signing
from framework.flask import redirect
from framework.exceptions import HTTPError
from .core import Auth
from .core import User
def collect_auth(func):
... | 27.56383 | 120 | 0.603242 |
import time
import httplib
import functools
from flask import request
from framework.auth import cas
from framework.auth import signing
from framework.flask import redirect
from framework.exceptions import HTTPError
from .core import Auth
from .core import User
def collect_auth(func):
@functools.wraps(func)
... | true | true |
f731751fa69ae18a6c65a0e7b8a660da710c2f8f | 663 | py | Python | model.py | SMMousaviSP/Sudoku-Solver | 13ab46585aaa1c8072ace58f0eee6df7388f684e | [
"MIT"
] | 26 | 2020-01-25T16:51:01.000Z | 2021-08-02T10:34:49.000Z | model.py | SMMousaviSP/Sudoku-Solver | 13ab46585aaa1c8072ace58f0eee6df7388f684e | [
"MIT"
] | 1 | 2021-04-26T09:03:39.000Z | 2021-04-26T09:03:39.000Z | model.py | SMMousaviSP/Sudoku-Solver | 13ab46585aaa1c8072ace58f0eee6df7388f684e | [
"MIT"
] | 21 | 2020-01-27T08:14:20.000Z | 2021-11-23T07:51:46.000Z | import keras
from keras.layers import Activation
from keras.layers import Conv2D, BatchNormalization, Dense, Flatten, Reshape
def get_model():
model = keras.models.Sequential()
model.add(Conv2D(64, kernel_size=(3,3), activation='relu', padding='same', input_shape=(9,9,1)))
model.add(BatchNormalization())... | 31.571429 | 100 | 0.689291 | import keras
from keras.layers import Activation
from keras.layers import Conv2D, BatchNormalization, Dense, Flatten, Reshape
def get_model():
model = keras.models.Sequential()
model.add(Conv2D(64, kernel_size=(3,3), activation='relu', padding='same', input_shape=(9,9,1)))
model.add(BatchNormalization())... | true | true |
f73175349ae72496647a8ded5362832c8f303bf2 | 45,377 | py | Python | exp/cips3d_inversion/models/generator_v2.py | PeterouZh/CIPS-3D | 9b8bfa0fb23f642af042e150ccd70408f9d137c6 | [
"MIT"
] | 308 | 2021-10-19T17:29:14.000Z | 2022-03-31T11:54:45.000Z | exp/cips3d_inversion/models/generator_v2.py | PeterouZh/CIPS-3D | 9b8bfa0fb23f642af042e150ccd70408f9d137c6 | [
"MIT"
] | 28 | 2021-10-31T22:49:00.000Z | 2022-03-25T05:49:47.000Z | exp/cips3d_inversion/models/generator_v2.py | PeterouZh/CIPS-3D | 9b8bfa0fb23f642af042e150ccd70408f9d137c6 | [
"MIT"
] | 44 | 2021-10-21T10:08:23.000Z | 2022-03-16T10:05:08.000Z | from itertools import chain
import math
import logging
import collections
from collections import OrderedDict
import tqdm
import random
import time
from einops import rearrange, repeat
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.cuda.amp import autocast
from tl2.pr... | 32.668826 | 120 | 0.571721 | from itertools import chain
import math
import logging
import collections
from collections import OrderedDict
import tqdm
import random
import time
from einops import rearrange, repeat
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.cuda.amp import autocast
from tl2.pr... | true | true |
f73176b9df2d9d3e6551836091e9a8f8bdc64a68 | 9,041 | py | Python | src/pyrobot/habitat/base.py | cihuang123/pyrobot | fe620097e31d11453b5ea7ac15e40f5f5721b29a | [
"MIT"
] | 2,150 | 2019-06-12T20:55:41.000Z | 2022-03-21T07:14:51.000Z | src/pyrobot/habitat/base.py | cihuang123/pyrobot | fe620097e31d11453b5ea7ac15e40f5f5721b29a | [
"MIT"
] | 124 | 2019-06-22T17:12:27.000Z | 2022-02-26T11:43:13.000Z | src/pyrobot/habitat/base.py | cihuang123/pyrobot | fe620097e31d11453b5ea7ac15e40f5f5721b29a | [
"MIT"
] | 329 | 2019-06-13T03:03:54.000Z | 2022-03-30T07:04:55.000Z | import numpy as np
import math
import pyrobot.utils.util as prutil
import rospy
import habitat_sim.agent as habAgent
import habitat_sim.utils as habUtils
from habitat_sim.agent.controls import ActuationSpec
import habitat_sim.errors
import quaternion
from tf.transformations import euler_from_quaternion, euler_from_mat... | 36.603239 | 93 | 0.623825 | import numpy as np
import math
import pyrobot.utils.util as prutil
import rospy
import habitat_sim.agent as habAgent
import habitat_sim.utils as habUtils
from habitat_sim.agent.controls import ActuationSpec
import habitat_sim.errors
import quaternion
from tf.transformations import euler_from_quaternion, euler_from_mat... | true | true |
f73176e6fa8ce3c0edc651c2858ea483ba4fd4a1 | 5,318 | py | Python | fritzconnection/fritzhosts.py | deisi/fritzconnection | b5c14515e1c8e2652b06b6316a7f3913df942841 | [
"MIT"
] | 2 | 2016-11-14T18:58:56.000Z | 2021-03-12T10:15:03.000Z | fritzconnection/fritzhosts.py | deisi/fritzconnection | b5c14515e1c8e2652b06b6316a7f3913df942841 | [
"MIT"
] | 2 | 2015-12-09T20:12:08.000Z | 2016-11-02T15:03:19.000Z | fritzconnection/fritzhosts.py | deisi/fritzconnection | b5c14515e1c8e2652b06b6316a7f3913df942841 | [
"MIT"
] | 7 | 2016-10-02T18:37:20.000Z | 2021-09-14T21:29:28.000Z | # -*- coding: utf-8 -*-
__version__ = '0.4.6'
import argparse
from . import fritzconnection
SERVICE = 'Hosts'
# version-access:
def get_version():
return __version__
class FritzHosts(object):
def __init__(self,
fc=None,
address=fritzconnection.FRITZ_IP_ADDRESS,
... | 32.036145 | 79 | 0.520496 |
__version__ = '0.4.6'
import argparse
from . import fritzconnection
SERVICE = 'Hosts'
def get_version():
return __version__
class FritzHosts(object):
def __init__(self,
fc=None,
address=fritzconnection.FRITZ_IP_ADDRESS,
port=fritzconnection.FRITZ_TCP_P... | true | true |
f731785fe68dc453314df05fd73e25b0eaf40c95 | 7,738 | py | Python | pygments/lexers/rust.py | beasleyr-vmw/pygments | bd166a3bb5452efd3a37a52d4847cae96d3d45e2 | [
"BSD-2-Clause"
] | 6,989 | 2017-07-18T06:23:18.000Z | 2022-03-31T15:58:36.000Z | pygments/lexers/rust.py | beasleyr-vmw/pygments | bd166a3bb5452efd3a37a52d4847cae96d3d45e2 | [
"BSD-2-Clause"
] | 1,978 | 2017-07-18T09:17:58.000Z | 2022-03-31T14:28:43.000Z | pygments/lexers/rust.py | beasleyr-vmw/pygments | bd166a3bb5452efd3a37a52d4847cae96d3d45e2 | [
"BSD-2-Clause"
] | 1,228 | 2017-07-18T09:03:13.000Z | 2022-03-29T05:57:40.000Z | # -*- coding: utf-8 -*-
"""
pygments.lexers.rust
~~~~~~~~~~~~~~~~~~~~
Lexers for the Rust language.
:copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.lexer import RegexLexer, include, bygroups, words, default
from pygments... | 35.013575 | 79 | 0.415094 |
from pygments.lexer import RegexLexer, include, bygroups, words, default
from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
Number, Punctuation, Whitespace
__all__ = ['RustLexer']
class RustLexer(RegexLexer):
name = 'Rust'
filenames = ['*.rs', '*.rs.in']
aliases = ['rust', ... | true | true |
f731786dd9a6f98ebccbad8bbac311e06ceed81d | 200 | py | Python | apps/users/utils.py | Yunloop/RoadBlog | d27504096cf00357c8f18737721b9b117b0203d9 | [
"MIT"
] | 1 | 2019-09-18T10:51:55.000Z | 2019-09-18T10:51:55.000Z | apps/users/utils.py | Yunloop/road | d27504096cf00357c8f18737721b9b117b0203d9 | [
"MIT"
] | 9 | 2020-06-05T23:14:20.000Z | 2022-02-10T11:36:14.000Z | apps/users/utils.py | Yunloop/road | d27504096cf00357c8f18737721b9b117b0203d9 | [
"MIT"
] | null | null | null | def jwt_response_payload_handler(token, user=None, request=None):
"""
重写获取jwt载荷数据方法
"""
return {
'token': token,
'id': user.id,
'username': user.username
}
| 20 | 65 | 0.56 | def jwt_response_payload_handler(token, user=None, request=None):
return {
'token': token,
'id': user.id,
'username': user.username
}
| true | true |
f73179932da21703dc52d5ead50dafad85c3d14a | 11,369 | py | Python | pydantic_sqlite/_core.py | Phil997/pydantic_sqlite | d52d0f42045c90b47a8e6987ec60dd071444f427 | [
"MIT"
] | 3 | 2022-01-11T06:02:45.000Z | 2022-02-07T06:07:29.000Z | pydantic_sqlite/_core.py | Phil997/pydantic_sqlite | d52d0f42045c90b47a8e6987ec60dd071444f427 | [
"MIT"
] | null | null | null | pydantic_sqlite/_core.py | Phil997/pydantic_sqlite | d52d0f42045c90b47a8e6987ec60dd071444f427 | [
"MIT"
] | null | null | null | import importlib
import inspect
import json
import os
import sqlite3
import tempfile
import typing
from shutil import copyfile
from typing import Any, Generator, List, Union
from pydantic import BaseModel, root_validator
from pydantic.fields import ModelField
from sqlite_utils import Database as _Database
from typing_... | 46.215447 | 158 | 0.648078 | import importlib
import inspect
import json
import os
import sqlite3
import tempfile
import typing
from shutil import copyfile
from typing import Any, Generator, List, Union
from pydantic import BaseModel, root_validator
from pydantic.fields import ModelField
from sqlite_utils import Database as _Database
from typing_... | true | true |
f7317ac183acdc3fef988d0b36002f1c1f9db05e | 7,610 | py | Python | env/lib/python3.6/site-packages/nibabel/tests/test_filename_parser.py | Raniac/NEURO-LEARN | 3c3acc55de8ba741e673063378e6cbaf10b64c7a | [
"Apache-2.0"
] | 8 | 2019-05-29T09:38:30.000Z | 2021-01-20T03:36:59.000Z | env/lib/python3.6/site-packages/nibabel/tests/test_filename_parser.py | Raniac/neurolearn_dev | 3c3acc55de8ba741e673063378e6cbaf10b64c7a | [
"Apache-2.0"
] | 12 | 2021-03-09T03:01:16.000Z | 2022-03-11T23:59:36.000Z | env/lib/python3.6/site-packages/nibabel/tests/test_filename_parser.py | Raniac/NEURO-LEARN | 3c3acc55de8ba741e673063378e6cbaf10b64c7a | [
"Apache-2.0"
] | 1 | 2020-07-17T12:49:49.000Z | 2020-07-17T12:49:49.000Z | # emacs: -*- mode: python-mode; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the NiBabel package for the
# copyright and license terms.
#
### ### ### #... | 43.988439 | 79 | 0.49724 |
from ..filename_parser import (types_filenames, TypesFilenamesError,
parse_filename, splitext_addext)
from nose.tools import (assert_equal, assert_true, assert_false,
assert_raises)
def test_filenames():
types_exts = (('image', '.img'), ('header', '.hdr'))
... | true | true |
f7317b0eda9c7facface10dbec8642b54e7fc9d2 | 2,521 | py | Python | polling_stations/apps/data_collection/management/commands/import_tower_hamlets.py | chris48s/UK-Polling-Stations | 4742b527dae94f0276d35c80460837be743b7d17 | [
"BSD-3-Clause"
] | null | null | null | polling_stations/apps/data_collection/management/commands/import_tower_hamlets.py | chris48s/UK-Polling-Stations | 4742b527dae94f0276d35c80460837be743b7d17 | [
"BSD-3-Clause"
] | null | null | null | polling_stations/apps/data_collection/management/commands/import_tower_hamlets.py | chris48s/UK-Polling-Stations | 4742b527dae94f0276d35c80460837be743b7d17 | [
"BSD-3-Clause"
] | null | null | null | """
Import Tower Hamlets
"""
from time import sleep
from django.contrib.gis.geos import Point
from data_collection.management.commands import BaseCsvStationsCsvAddressesImporter
from data_finder.helpers import geocode, geocode_point_only, PostcodeError
from addressbase.models import Address
class Command(BaseCsvSta... | 31.5125 | 83 | 0.548195 | from time import sleep
from django.contrib.gis.geos import Point
from data_collection.management.commands import BaseCsvStationsCsvAddressesImporter
from data_finder.helpers import geocode, geocode_point_only, PostcodeError
from addressbase.models import Address
class Command(BaseCsvStationsCsvAddressesImporter):
... | true | true |
f7317c3b8b64c75edaf8033692d2b70b5b070677 | 10,874 | py | Python | test/shake_test.py | arkottke/MapIO | dd6e347dce2d65b7bd4c489a03d8883d0e4210fc | [
"CC0-1.0"
] | null | null | null | test/shake_test.py | arkottke/MapIO | dd6e347dce2d65b7bd4c489a03d8883d0e4210fc | [
"CC0-1.0"
] | null | null | null | test/shake_test.py | arkottke/MapIO | dd6e347dce2d65b7bd4c489a03d8883d0e4210fc | [
"CC0-1.0"
] | 1 | 2019-11-09T16:05:37.000Z | 2019-11-09T16:05:37.000Z | #!/usr/bin/env python
#python 3 compatibility
from __future__ import print_function
#stdlib imports
from xml.dom import minidom
from datetime import datetime
from collections import OrderedDict
import re
import sys
import tempfile
import time
import shutil
if sys.version_info.major == 2:
import StringIO
else:
... | 41.503817 | 112 | 0.532279 |
from __future__ import print_function
from xml.dom import minidom
from datetime import datetime
from collections import OrderedDict
import re
import sys
import tempfile
import time
import shutil
if sys.version_info.major == 2:
import StringIO
else:
from io import StringIO
import os.path
homedir = os.path.di... | true | true |
f7317c790976f2907b99356b3b5fdcac78c33a12 | 1,014 | py | Python | python/tests/integration/postgres/test_postgres_results.py | Vjrx/airship-drydock | 315fb9864e6d55a66d5266f76c160be55d22c98b | [
"Apache-2.0"
] | 14 | 2017-03-07T17:00:22.000Z | 2021-04-02T14:15:04.000Z | python/tests/integration/postgres/test_postgres_results.py | Vjrx/airship-drydock | 315fb9864e6d55a66d5266f76c160be55d22c98b | [
"Apache-2.0"
] | 82 | 2017-02-16T16:54:18.000Z | 2018-06-04T13:40:32.000Z | python/tests/integration/postgres/test_postgres_results.py | Vjrx/airship-drydock | 315fb9864e6d55a66d5266f76c160be55d22c98b | [
"Apache-2.0"
] | 16 | 2017-02-14T19:47:00.000Z | 2018-04-26T10:13:05.000Z | import pytest
from drydock_provisioner import objects
class TestPostgres(object):
def test_result_message_insert(self, populateddb, drydock_state):
"""Test that a result message for a task can be added."""
msg1 = objects.TaskStatusMessage('Error 1', True, 'node', 'node1')
msg2 = objects.T... | 31.6875 | 77 | 0.675542 | import pytest
from drydock_provisioner import objects
class TestPostgres(object):
def test_result_message_insert(self, populateddb, drydock_state):
msg1 = objects.TaskStatusMessage('Error 1', True, 'node', 'node1')
msg2 = objects.TaskStatusMessage('Status 1', False, 'node', 'node1')
resu... | true | true |
f7317c8199b599b34a14ce19dda9e2ac6e37c688 | 42,329 | py | Python | modin/pandas/test/dataframe/test_map_metadata.py | palash247/modin | 3f1e275b67a760f09db6944600c4b7f5e601cbde | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | modin/pandas/test/dataframe/test_map_metadata.py | palash247/modin | 3f1e275b67a760f09db6944600c4b7f5e601cbde | [
"ECL-2.0",
"Apache-2.0"
] | 46 | 2020-08-28T09:12:51.000Z | 2021-04-20T00:01:04.000Z | modin/pandas/test/dataframe/test_map_metadata.py | monocilindro/modin | ffea4ee2d3556dc48c05dac7abb54b62c66f3153 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Licensed to Modin Development Team under one or more contributor license agreements.
# See the NOTICE file distributed with this work for additional information regarding
# copyright ownership. The Modin Development Team licenses this file to you under the
# Apache License, Version 2.0 (the "License"); you may not u... | 32.585835 | 88 | 0.644924 |
import pytest
import numpy as np
import pandas
from pandas.testing import assert_index_equal
import matplotlib
import modin.pandas as pd
from modin.utils import get_current_backend
from modin.pandas.test.utils import (
random_state,
RAND_LOW,
RAND_HIGH,
df_equals,
df_is_empty,
arg_keys,
na... | true | true |
f7317cf731b0cf356e1cea4ede7915e02f90b539 | 7,087 | py | Python | litex_boards/targets/alveo_u250.py | quiatvn/litex-boards | 70c32a978fb588b3144a9e3cf9a63562f5505b7f | [
"BSD-2-Clause"
] | null | null | null | litex_boards/targets/alveo_u250.py | quiatvn/litex-boards | 70c32a978fb588b3144a9e3cf9a63562f5505b7f | [
"BSD-2-Clause"
] | null | null | null | litex_boards/targets/alveo_u250.py | quiatvn/litex-boards | 70c32a978fb588b3144a9e3cf9a63562f5505b7f | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3
#
# This file is part of LiteX-Boards.
#
# Copyright (c) 2020 Fei Gao <feig@princeton.edu>
# Copyright (c) 2020 Florent Kermarrec <florent@enjoy-digital.fr>
# Copyright (c) 2020 David Shah <dave@ds0.me>
# SPDX-License-Identifier: BSD-2-Clause
import argparse, os
from migen import *
from litex... | 41.934911 | 100 | 0.56272 |
import argparse, os
from migen import *
from litex_boards.platforms import alveo_u250
from litex.soc.cores.clock import *
from litex.soc.integration.soc_core import *
from litex.soc.integration.soc_sdram import *
from litex.soc.integration.builder import *
from litex.soc.cores.led import LedChaser
from litedram.m... | true | true |
f7317da5336aa017fc94a0299d3bac8f2c5c34b4 | 7,740 | py | Python | facebook_insights/metrics.py | jaylynch/django-facebook-insights | b10f1662f2f346bea19bc84629a8079257c9d710 | [
"MIT"
] | null | null | null | facebook_insights/metrics.py | jaylynch/django-facebook-insights | b10f1662f2f346bea19bc84629a8079257c9d710 | [
"MIT"
] | null | null | null | facebook_insights/metrics.py | jaylynch/django-facebook-insights | b10f1662f2f346bea19bc84629a8079257c9d710 | [
"MIT"
] | 1 | 2019-05-30T06:23:47.000Z | 2019-05-30T06:23:47.000Z | """Tools to fetch and extract Facebook Insights metrics.
>>> graph_id = '1234567890'
>>> metrics = ['page_impressions', 'page_engaged_users']
>>> page_metrics = fetch_metrics(graph_id, metrics)
>>> page_impressions = page_metrics['page_impressions']
>>> page_impressions.values
{'day': [
{'end_time': '2016-11-15T08... | 34.247788 | 79 | 0.589922 | import json
from django.conf import settings
from facebook import GraphAPI, GraphAPIError
from facebook_insights.exceptions import EmptyData, MetricsNotSpecified
__all__ = ['fetch_metrics', 'Metric']
access_token = settings.FACEBOOK_INSIGHTS_ACCESS_TOKEN
api_version = getattr(settings, 'FACEBOOK_INSIGHTS_API_VERSIO... | true | true |
f7317dea433a8c808e75878075c74d8bf4391756 | 11,458 | py | Python | Lib/test/test_timeout.py | sireliah/polish-python | 605df4944c2d3bc25f8bf6964b274c0a0d297cc3 | [
"PSF-2.0"
] | 1 | 2018-06-21T18:21:24.000Z | 2018-06-21T18:21:24.000Z | Lib/test/test_timeout.py | sireliah/polish-python | 605df4944c2d3bc25f8bf6964b274c0a0d297cc3 | [
"PSF-2.0"
] | null | null | null | Lib/test/test_timeout.py | sireliah/polish-python | 605df4944c2d3bc25f8bf6964b274c0a0d297cc3 | [
"PSF-2.0"
] | null | null | null | """Unit tests dla socket timeout feature."""
zaimportuj functools
zaimportuj unittest
z test zaimportuj support
# This requires the 'network' resource jako given on the regrtest command line.
skip_expected = nie support.is_resource_enabled('network')
zaimportuj time
zaimportuj errno
zaimportuj socket
@functools.lr... | 37.690789 | 84 | 0.629516 | """Unit tests dla socket timeout feature."""
zaimportuj functools
zaimportuj unittest
z test zaimportuj support
skip_expected = nie support.is_resource_enabled('network')
zaimportuj time
zaimportuj errno
zaimportuj socket
@functools.lru_cache()
def resolve_address(host, port):
"""Resolve an (host, port) to an ... | false | true |
f7317e2c185510c822951fefebfbee8e10479664 | 38,094 | py | Python | t3f/riemannian.py | aiboyko/t3f | 0361b80f36a06eb5aa5d536650eef9e006289139 | [
"MIT"
] | null | null | null | t3f/riemannian.py | aiboyko/t3f | 0361b80f36a06eb5aa5d536650eef9e006289139 | [
"MIT"
] | null | null | null | t3f/riemannian.py | aiboyko/t3f | 0361b80f36a06eb5aa5d536650eef9e006289139 | [
"MIT"
] | null | null | null | import tensorflow.compat.v1 as tf
from t3f.tensor_train import TensorTrain
from t3f.tensor_train_batch import TensorTrainBatch
from t3f import shapes
from t3f import decompositions
def project_sum(what, where, weights=None):
"""Project sum of `what` TTs on the tangent space of `where` TT.
project_sum(what, x) =... | 42.898649 | 101 | 0.664908 | import tensorflow.compat.v1 as tf
from t3f.tensor_train import TensorTrain
from t3f.tensor_train_batch import TensorTrainBatch
from t3f import shapes
from t3f import decompositions
def project_sum(what, where, weights=None):
what = shapes.expand_batch_dim(what)
if weights is not None:
weights = tf.convert... | true | true |
f7317ee14c32df99d8957b13095c5f0979815548 | 11,872 | py | Python | intake_esm/cat.py | agstephens/intake-esm | 25ead83497d025c37a80abdbefee9b286934308b | [
"Apache-2.0"
] | null | null | null | intake_esm/cat.py | agstephens/intake-esm | 25ead83497d025c37a80abdbefee9b286934308b | [
"Apache-2.0"
] | null | null | null | intake_esm/cat.py | agstephens/intake-esm | 25ead83497d025c37a80abdbefee9b286934308b | [
"Apache-2.0"
] | null | null | null | import enum
import json
import os
import pathlib
import typing
import fsspec
import pandas as pd
import pydantic
import tlz
from ._search import search, search_apply_require_all_on
class AggregationType(str, enum.Enum):
join_new = 'join_new'
join_existing = 'join_existing'
union = 'union'
class Con... | 33.254902 | 103 | 0.614976 | import enum
import json
import os
import pathlib
import typing
import fsspec
import pandas as pd
import pydantic
import tlz
from ._search import search, search_apply_require_all_on
class AggregationType(str, enum.Enum):
join_new = 'join_new'
join_existing = 'join_existing'
union = 'union'
class Con... | true | true |
f7317f9433b31ade91e5efd2feb76b31b2af0dcf | 228 | py | Python | adc/tth.py | udoprog/python-adc | 6e3775a6fddd0c4a12211a237e2ae5f62a79fd31 | [
"BSD-3-Clause"
] | 1 | 2015-02-01T15:05:16.000Z | 2015-02-01T15:05:16.000Z | adc/tth.py | udoprog/python-adc | 6e3775a6fddd0c4a12211a237e2ae5f62a79fd31 | [
"BSD-3-Clause"
] | null | null | null | adc/tth.py | udoprog/python-adc | 6e3775a6fddd0c4a12211a237e2ae5f62a79fd31 | [
"BSD-3-Clause"
] | null | null | null | from merkletree import MerkleTree
from .hashing import TigerHash
class TigerTree(MerkleTree):
segment = 1024;
hashsize = TigerHash.size;
@classmethod
def _hash(klass, *chunks):
return TigerHash.digest(*chunks);
| 19 | 37 | 0.741228 | from merkletree import MerkleTree
from .hashing import TigerHash
class TigerTree(MerkleTree):
segment = 1024;
hashsize = TigerHash.size;
@classmethod
def _hash(klass, *chunks):
return TigerHash.digest(*chunks);
| true | true |
f7318003a4d1f4c23a5fc12ba056718d045c25e6 | 3,232 | py | Python | dataflows/processors/parallelize.py | cschloer/dataflows | 78a683b5d202512c06021ff6be8ac7f60ef1cd9b | [
"MIT"
] | null | null | null | dataflows/processors/parallelize.py | cschloer/dataflows | 78a683b5d202512c06021ff6be8ac7f60ef1cd9b | [
"MIT"
] | null | null | null | dataflows/processors/parallelize.py | cschloer/dataflows | 78a683b5d202512c06021ff6be8ac7f60ef1cd9b | [
"MIT"
] | null | null | null | import itertools
import os
import multiprocessing as mp
import threading
import queue
from ..helpers import ResourceMatcher
from .. import PackageWrapper, ResourceWrapper
def init_mp(num_processors, row_func, q_in, q_internal):
q_out = mp.Queue()
processes = [mp.Process(target=work, args=(q_in, q_out, row_fu... | 26.933333 | 111 | 0.569926 | import itertools
import os
import multiprocessing as mp
import threading
import queue
from ..helpers import ResourceMatcher
from .. import PackageWrapper, ResourceWrapper
def init_mp(num_processors, row_func, q_in, q_internal):
q_out = mp.Queue()
processes = [mp.Process(target=work, args=(q_in, q_out, row_fu... | true | true |
f73180d03d5ce10b4c3dc13aefb29b163648e360 | 3,306 | py | Python | data/p2DJ/New/program/qiskit/simulator/startQiskit336.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p2DJ/New/program/qiskit/simulator/startQiskit336.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p2DJ/New/program/qiskit/simulator/startQiskit336.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=2
# total number=18
import cirq
import qiskit
from qiskit import IBMQ
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2,floor, sqrt, pi
import numpy a... | 28.747826 | 82 | 0.625227 | import cirq
import qiskit
from qiskit import IBMQ
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2,floor, sqrt, pi
import numpy as np
import networkx as nx
def bui... | true | true |
f73180ffb7b8ac7ff84ef16f39b5d76cd4a45949 | 255 | py | Python | tests/urls.py | srijwalzartek/django-slick-reporting | aed9262a3dd83aa28e141301a4b3bf7041be7748 | [
"BSD-3-Clause"
] | null | null | null | tests/urls.py | srijwalzartek/django-slick-reporting | aed9262a3dd83aa28e141301a4b3bf7041be7748 | [
"BSD-3-Clause"
] | null | null | null | tests/urls.py | srijwalzartek/django-slick-reporting | aed9262a3dd83aa28e141301a4b3bf7041be7748 | [
"BSD-3-Clause"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path('report1/', views.MonthlyProductSales.as_view(), name='report1'),
path('product_crosstab_client/', views.ProductClientSalesMatrix.as_view(), name='product_crosstab_client'),
]
| 31.875 | 111 | 0.756863 | from django.urls import path
from . import views
urlpatterns = [
path('report1/', views.MonthlyProductSales.as_view(), name='report1'),
path('product_crosstab_client/', views.ProductClientSalesMatrix.as_view(), name='product_crosstab_client'),
]
| true | true |
f7318134d4c39845139626c088e97f1dd313f92c | 4,575 | py | Python | minecraft_dynmap_timemachine/dynmap.py | paul-eff/minecraft-dynmap-timemachine | ee902fe6600023a3de2d3b71969738016914a03a | [
"MIT"
] | 61 | 2015-05-22T17:30:09.000Z | 2022-02-26T20:22:15.000Z | minecraft_dynmap_timemachine/dynmap.py | paul-eff/minecraft-dynmap-timemachine | ee902fe6600023a3de2d3b71969738016914a03a | [
"MIT"
] | 10 | 2017-07-18T18:34:42.000Z | 2022-03-09T01:49:13.000Z | minecraft_dynmap_timemachine/dynmap.py | paul-eff/minecraft-dynmap-timemachine | ee902fe6600023a3de2d3b71969738016914a03a | [
"MIT"
] | 18 | 2017-12-28T10:44:54.000Z | 2022-02-26T01:33:05.000Z | # import urllib
import json
import time
import math
import re
from . import simple_downloader
class MapException(Exception):
def __init__(self, map_obj, *args, **kwargs):
super(MapException, self).__init__(*args, **kwargs)
self.map = map_obj
class DynMap(object):
def __init__(self, url):
... | 28.773585 | 136 | 0.599344 | import json
import time
import math
import re
from . import simple_downloader
class MapException(Exception):
def __init__(self, map_obj, *args, **kwargs):
super(MapException, self).__init__(*args, **kwargs)
self.map = map_obj
class DynMap(object):
def __init__(self, url):
s... | true | true |
f731817c0c67a924ce2ccfc634deaf68c68b5c57 | 54,791 | py | Python | numpy/polynomial/hermite.py | ivanov/numpy | 6d2665626e40f346bb5af8d780579f5a429ff9ba | [
"BSD-3-Clause"
] | null | null | null | numpy/polynomial/hermite.py | ivanov/numpy | 6d2665626e40f346bb5af8d780579f5a429ff9ba | [
"BSD-3-Clause"
] | null | null | null | numpy/polynomial/hermite.py | ivanov/numpy | 6d2665626e40f346bb5af8d780579f5a429ff9ba | [
"BSD-3-Clause"
] | null | null | null | """
Objects for dealing with Hermite series.
This module provides a number of objects (mostly functions) useful for
dealing with Hermite series, including a `Hermite` class that
encapsulates the usual arithmetic operations. (General information
on how this module represents and works with such polynomials is in the
d... | 31.291262 | 79 | 0.597416 | from __future__ import division, absolute_import
import numpy as np
import numpy.linalg as la
from . import polyutils as pu
import warnings
from .polytemplate import polytemplate
__all__ = ['hermzero', 'hermone', 'hermx', 'hermdomain', 'hermline',
'hermadd', 'hermsub', 'hermmulx', 'hermmul', 'hermdiv', 'hermpow',... | true | true |
f73182b901161d28b67b66626d7189fdce69c7df | 368 | py | Python | utilities/models.py | codes-dev/qubwebs-blog | 0ba9372b2ec83ad181dbd31eb009a17a4a7acaf0 | [
"MIT"
] | null | null | null | utilities/models.py | codes-dev/qubwebs-blog | 0ba9372b2ec83ad181dbd31eb009a17a4a7acaf0 | [
"MIT"
] | null | null | null | utilities/models.py | codes-dev/qubwebs-blog | 0ba9372b2ec83ad181dbd31eb009a17a4a7acaf0 | [
"MIT"
] | null | null | null | from django.db import models
# Create your models here.
class TimeStampMixin(models.Model):
"""
An abstract base class model that provides self-updating
``created_at`` and ``updated_at`` fields.
"""
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_no... | 24.533333 | 60 | 0.701087 | from django.db import models
class TimeStampMixin(models.Model):
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
class Meta:
abstract = True | true | true |
f73182c1280def3ee7b87cc1f8310cdf39c87b12 | 16,051 | py | Python | fairseq/fairseq/data/indexed_dataset.py | oguzdemirbasci/DynamicVocabAbstractiveSummariser | 2e8ba9efd6eddd7d1870d540638f05c80bfe9894 | [
"MIT"
] | null | null | null | fairseq/fairseq/data/indexed_dataset.py | oguzdemirbasci/DynamicVocabAbstractiveSummariser | 2e8ba9efd6eddd7d1870d540638f05c80bfe9894 | [
"MIT"
] | null | null | null | fairseq/fairseq/data/indexed_dataset.py | oguzdemirbasci/DynamicVocabAbstractiveSummariser | 2e8ba9efd6eddd7d1870d540638f05c80bfe9894 | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from functools import lru_cache
import os
import shutil
import struct
import numpy as np
import torch
from . import FairseqDataset
def __b... | 30.631679 | 105 | 0.592611 |
from functools import lru_cache
import os
import shutil
import struct
import numpy as np
import torch
from . import FairseqDataset
def __best_fitting_dtype(vocab_size=None):
if vocab_size is not None and vocab_size < 65500:
return np.uint16
else:
return np.int32
def get_available_dataset_... | true | true |
f731833e514a80da7c83975fe621231e7f8586e1 | 994 | py | Python | assets/code/practice-example-four.py | david-story/david-story.github.io | 4a02854207b86946befd933d6f23773f6239d7da | [
"MIT"
] | null | null | null | assets/code/practice-example-four.py | david-story/david-story.github.io | 4a02854207b86946befd933d6f23773f6239d7da | [
"MIT"
] | null | null | null | assets/code/practice-example-four.py | david-story/david-story.github.io | 4a02854207b86946befd933d6f23773f6239d7da | [
"MIT"
] | null | null | null | """
Practice File 4
Created by David Story
Description: Some nice examples of things you can do with functions from the following libraries:
- sys
- os
- time
- datetime
"""
import sys
import os
import time
import datetime
# get the time
print(time.time())
# get the current date
print(datetime.date.... | 19.490196 | 97 | 0.740443 |
import sys
import os
import time
import datetime
print(time.time())
print(datetime.date.today())
print(os.getcwd())
your_working_directory = os.getcwd()
os.chdir("C:\\")
print(os.getcwd())
os.chdir(your_working_directory)
print(os.getcwd())
computer_cpu_count = os.cpu_count()
print("This computer has this ma... | true | true |
f731835a4a4d1abb694ef9dec2e9777f59218f60 | 390 | py | Python | NewRelicApiParser/REST/AlertsViolations/__init__.py | Bharat23/newrelic-api-parser | c55d508387fde33af9bdc93f16aae3cb2a2e5f13 | [
"MIT"
] | null | null | null | NewRelicApiParser/REST/AlertsViolations/__init__.py | Bharat23/newrelic-api-parser | c55d508387fde33af9bdc93f16aae3cb2a2e5f13 | [
"MIT"
] | 1 | 2021-07-30T17:32:37.000Z | 2021-07-30T17:32:37.000Z | NewRelicApiParser/REST/AlertsViolations/__init__.py | Bharat23/newrelic-api-parser | c55d508387fde33af9bdc93f16aae3cb2a2e5f13 | [
"MIT"
] | null | null | null | from NewRelicApiParser.Base import BaseNewRelic
class AlertsViolations(BaseNewRelic):
def __init__(self, API_KEY):
super().__init__(API_KEY)
def get_list(self, options: dict = {}) -> dict:
"""
fetch the alert violations for new relic
"""
url = self.BASE_URI + '/alerts_... | 30 | 55 | 0.651282 | from NewRelicApiParser.Base import BaseNewRelic
class AlertsViolations(BaseNewRelic):
def __init__(self, API_KEY):
super().__init__(API_KEY)
def get_list(self, options: dict = {}) -> dict:
url = self.BASE_URI + '/alerts_violations.json'
return super().get_data(url, options=options) | true | true |
f731839f44074592ff4c8fc120911ce2b706f06b | 2,652 | py | Python | utils/audio.py | deciding/Voicefilter | dda34da9d1cfca48102b2d1b4274bfd76e5a2e1c | [
"Apache-2.0",
"MIT"
] | 3 | 2020-03-25T06:27:20.000Z | 2021-02-28T12:59:14.000Z | utils/audio.py | deciding/Voicefilter | dda34da9d1cfca48102b2d1b4274bfd76e5a2e1c | [
"Apache-2.0",
"MIT"
] | null | null | null | utils/audio.py | deciding/Voicefilter | dda34da9d1cfca48102b2d1b4274bfd76e5a2e1c | [
"Apache-2.0",
"MIT"
] | null | null | null | # adapted from Keith Ito's tacotron implementation
# https://github.com/keithito/tacotron/blob/master/util/audio.py
import librosa
import numpy as np
class Audio():
def __init__(self, hp):
self.hp = hp
self.mel_basis = librosa.filters.mel(sr=hp.audio.sample_rate,
... | 36.833333 | 86 | 0.549397 | # https://github.com/keithito/tacotron/blob/master/util/audio.py
import librosa
import numpy as np
class Audio():
def __init__(self, hp):
self.hp = hp
self.mel_basis = librosa.filters.mel(sr=hp.audio.sample_rate,
n_fft=hp.embedder.n_fft,
... | true | true |
f73183abb453edfa3f42627d23629fd71241bbd0 | 1,790 | py | Python | keymint_cli/verb/__init__.py | keymint/keymint_cli | 977995ade32cf2b3a6394bda1c05f80a9fcc3369 | [
"Apache-2.0"
] | null | null | null | keymint_cli/verb/__init__.py | keymint/keymint_cli | 977995ade32cf2b3a6394bda1c05f80a9fcc3369 | [
"Apache-2.0"
] | null | null | null | keymint_cli/verb/__init__.py | keymint/keymint_cli | 977995ade32cf2b3a6394bda1c05f80a9fcc3369 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016-2017 Dirk Thomas
# Copyright 2017 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | 31.964286 | 74 | 0.721229 |
from keymint_cli.plugin_system import instantiate_extensions
from keymint_cli.plugin_system import PLUGIN_SYSTEM_VERSION
from keymint_cli.plugin_system import satisfies_version
class VerbExtension:
NAME = None
EXTENSION_POINT_VERSION = '0.1'
def __init__(self):
super(VerbExtension, self).__init... | true | true |
f7318473c64262e9daec3211788af8404125cccc | 722 | py | Python | webview/monitor/migrations/0002_auto_20191022_1952.py | dw0rdptr/2019_IoT_GoToDouble | 7f8a3005710b57199e918be1a0d8b9047918bce2 | [
"MIT"
] | 4 | 2019-10-23T04:43:09.000Z | 2019-10-24T11:25:37.000Z | webview/monitor/migrations/0002_auto_20191022_1952.py | dw0rdptr/2019_IoT_GoToDouble | 7f8a3005710b57199e918be1a0d8b9047918bce2 | [
"MIT"
] | 10 | 2019-10-22T12:06:42.000Z | 2019-10-24T17:39:31.000Z | webview/monitor/migrations/0002_auto_20191022_1952.py | epikjjh/2019_IoT_GoToDouble | 1d80eb87b7d59da90a7d0a9225209bfb4704a045 | [
"MIT"
] | 5 | 2019-10-22T08:04:26.000Z | 2019-10-24T17:31:40.000Z | # Generated by Django 2.2.6 on 2019-10-22 10:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('monitor', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Sposition',
fields=[
('id'... | 26.740741 | 114 | 0.548476 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('monitor', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Sposition',
fields=[
('id', models.AutoField(auto_created=True, primary_ke... | true | true |
f731847f66654d267e7a80dca13e796267689882 | 726 | py | Python | FlatCAMPool.py | NeverGET/FlatCAM | 5d3d0f2166695687aa319cc56919c971adc82843 | [
"MIT"
] | 63 | 2016-02-24T20:42:58.000Z | 2022-03-13T09:10:17.000Z | FlatCAMPool.py | NeverGET/FlatCAM | 5d3d0f2166695687aa319cc56919c971adc82843 | [
"MIT"
] | 7 | 2017-02-03T22:05:22.000Z | 2022-03-01T21:16:26.000Z | FlatCAMPool.py | NeverGET/FlatCAM | 5d3d0f2166695687aa319cc56919c971adc82843 | [
"MIT"
] | 27 | 2016-02-24T20:42:58.000Z | 2022-02-17T02:40:16.000Z | from PyQt4 import QtCore
from multiprocessing import Pool
import dill
def run_dill_encoded(what):
fun, args = dill.loads(what)
print "load", fun, args
return fun(*args)
def apply_async(pool, fun, args):
print "...", fun, args
print "dumps", dill.dumps((fun, args))
return pool.map_async(run_dil... | 25.034483 | 71 | 0.630854 | from PyQt4 import QtCore
from multiprocessing import Pool
import dill
def run_dill_encoded(what):
fun, args = dill.loads(what)
print "load", fun, args
return fun(*args)
def apply_async(pool, fun, args):
print "...", fun, args
print "dumps", dill.dumps((fun, args))
return pool.map_async(run_dil... | false | true |
f73184b05282cc90c8544a41fce552460381a5d0 | 17,311 | py | Python | src/k2hash/tests/test_k2hash.py | ggtakec/k2hash_python | 9d20d36aaf28d0dd2497d39b43286d50e7200fcc | [
"MIT"
] | 1 | 2022-03-02T10:27:43.000Z | 2022-03-02T10:27:43.000Z | src/k2hash/tests/test_k2hash.py | ggtakec/k2hash_python | 9d20d36aaf28d0dd2497d39b43286d50e7200fcc | [
"MIT"
] | null | null | null | src/k2hash/tests/test_k2hash.py | ggtakec/k2hash_python | 9d20d36aaf28d0dd2497d39b43286d50e7200fcc | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# K2hash Python Driver
#
# Copyright (c) 2022 Yahoo Japan Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limit... | 34.691383 | 80 | 0.617122 | import unittest
import k2hash
import logging
import ctypes
import time
class TestK2hashIterator(unittest.TestCase):
def test_K2hashIterator_construct(self):
db = k2hash.K2hash()
self.assertTrue(isinstance(db, k2hash.K2hash))
key = "hello"
val = "world"
self.assertTrue(db.se... | true | true |
f73184b337ca7e743751238f2a113e71bb8c75e0 | 7,364 | py | Python | tests/rundb/test_sqldb.py | EdmondIguazio/mlrun | e63b34a610788ebe522ce7a46642e26927e39882 | [
"Apache-2.0"
] | null | null | null | tests/rundb/test_sqldb.py | EdmondIguazio/mlrun | e63b34a610788ebe522ce7a46642e26927e39882 | [
"Apache-2.0"
] | null | null | null | tests/rundb/test_sqldb.py | EdmondIguazio/mlrun | e63b34a610788ebe522ce7a46642e26927e39882 | [
"Apache-2.0"
] | 1 | 2021-05-05T14:19:46.000Z | 2021-05-05T14:19:46.000Z | # Copyright 2019 Iguazio
#
# 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, softwa... | 33.022422 | 85 | 0.629957 |
from collections import defaultdict
from contextlib import contextmanager
from datetime import datetime, timedelta
from unittest.mock import Mock
import pytest
from sqlalchemy.orm import Session
from mlrun.api.db.sqldb.db import SQLDB
from mlrun.api.db.sqldb.models import _tagged
from tests.conftest import new_run
... | true | true |
f73184ce4006c41fecce4252dad30c23fe8ec11b | 974 | py | Python | pictures/iptc1.py | digcat/cmistest | f8718e09077b741cb885b4335719a99923c8b330 | [
"MIT"
] | null | null | null | pictures/iptc1.py | digcat/cmistest | f8718e09077b741cb885b4335719a99923c8b330 | [
"MIT"
] | null | null | null | pictures/iptc1.py | digcat/cmistest | f8718e09077b741cb885b4335719a99923c8b330 | [
"MIT"
] | null | null | null | from iptcinfo import IPTCInfo
import sys
fn = (len(sys.argv) > 1 and [sys.argv[1]] or ['test.jpg'])[0]
fn2 = (len(sys.argv) > 2 and [sys.argv[2]] or ['test_out.jpg'])[0]
# Create new info object
info = IPTCInfo(fn)
# Check if file had IPTC data
if len(info.data) < 4: raise Exception(info.error)
# Print list of keyw... | 23.756098 | 66 | 0.719713 | from iptcinfo import IPTCInfo
import sys
fn = (len(sys.argv) > 1 and [sys.argv[1]] or ['test.jpg'])[0]
fn2 = (len(sys.argv) > 2 and [sys.argv[2]] or ['test_out.jpg'])[0]
info = IPTCInfo(fn)
if len(info.data) < 4: raise Exception(info.error)
print "KEYWORDS"
print info.keywords
print "SUPPLEMENTAL"
print info.supple... | false | true |
f731851b0bbc67a1b6af6e831923eba84d6c28aa | 10,964 | py | Python | rustplus/api/rust_api.py | olijeffers0n/rustplus.py | 0ecaaecc345848b47abe27bc1fd8b7ef7aebfd23 | [
"MIT"
] | 25 | 2021-05-03T11:08:55.000Z | 2022-03-14T00:56:50.000Z | rustplus/api/rust_api.py | olijeffers0n/rustplus.py | 0ecaaecc345848b47abe27bc1fd8b7ef7aebfd23 | [
"MIT"
] | 9 | 2021-06-15T10:38:42.000Z | 2022-03-26T11:45:03.000Z | rustplus/api/rust_api.py | olijeffers0n/rustplus.py | 0ecaaecc345848b47abe27bc1fd8b7ef7aebfd23 | [
"MIT"
] | 13 | 2021-06-08T18:35:17.000Z | 2022-03-26T00:44:08.000Z | import asyncio
from asyncio.futures import Future
from typing import List
from PIL import Image
from io import BytesIO
from importlib import resources
from datetime import datetime
from collections import defaultdict
from .base_rust_api import BaseRustSocket
from .structures import RustTime, RustInfo, RustMap, RustMar... | 36.915825 | 265 | 0.639639 | import asyncio
from asyncio.futures import Future
from typing import List
from PIL import Image
from io import BytesIO
from importlib import resources
from datetime import datetime
from collections import defaultdict
from .base_rust_api import BaseRustSocket
from .structures import RustTime, RustInfo, RustMap, RustMar... | true | true |
f73185ddbd238f0f843033c23cdf25d8077121c5 | 989 | py | Python | tests/sparseml/onnx/test_imports.py | clementpoiret/sparseml | 8442a6ef8ba11fb02f5e51472dd68b72438539b9 | [
"Apache-2.0"
] | 922 | 2021-02-04T17:51:54.000Z | 2022-03-31T20:49:26.000Z | tests/sparseml/onnx/test_imports.py | clementpoiret/sparseml | 8442a6ef8ba11fb02f5e51472dd68b72438539b9 | [
"Apache-2.0"
] | 197 | 2021-02-04T22:17:21.000Z | 2022-03-31T13:58:55.000Z | tests/sparseml/onnx/test_imports.py | clementpoiret/sparseml | 8442a6ef8ba11fb02f5e51472dd68b72438539b9 | [
"Apache-2.0"
] | 80 | 2021-02-04T22:20:14.000Z | 2022-03-30T19:36:15.000Z | # Copyright (c) 2021 - present / Neuralmagic, 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 b... | 30.90625 | 76 | 0.695652 |
def test_imports():
from sparseml.onnx import (
check_onnx_install,
check_onnxruntime_install,
detect_framework,
framework_info,
is_supported,
onnx,
onnx_err,
onnxruntime,
onnxruntime_err,
require_onnx,
require_onnxruntime... | true | true |
f73186d8775e20db4e181ff54bb6713045cc02fc | 7,745 | py | Python | demo/demo.py | hummat/detectron2 | ef2f4df474b4a07049cada4793392e8e36c3e746 | [
"Apache-2.0"
] | null | null | null | demo/demo.py | hummat/detectron2 | ef2f4df474b4a07049cada4793392e8e36c3e746 | [
"Apache-2.0"
] | null | null | null | demo/demo.py | hummat/detectron2 | ef2f4df474b4a07049cada4793392e8e36c3e746 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
import argparse
import glob
import multiprocessing as mp
import numpy as np
import os
import tempfile
import time
import warnings
import cv2
import tqdm
from detectron2.config import get_cfg
from detectron2.data.detection_utils import read_image
from detectron2.utils.... | 39.116162 | 128 | 0.628922 | import argparse
import glob
import multiprocessing as mp
import numpy as np
import os
import tempfile
import time
import warnings
import cv2
import tqdm
from detectron2.config import get_cfg
from detectron2.data.detection_utils import read_image
from detectron2.utils.logger import setup_logger
from predictor import V... | true | true |
f731877388c6e4f2d7121cb542ca1fe6ff75cc62 | 1,466 | py | Python | xcc/util.py | BastianZim/xanadu-cloud-client | 3a2d9d5373d90339a1047ee939bacef1bd4019ed | [
"Apache-2.0"
] | 3 | 2021-11-12T21:44:35.000Z | 2022-02-10T15:07:20.000Z | xcc/util.py | BastianZim/xanadu-cloud-client | 3a2d9d5373d90339a1047ee939bacef1bd4019ed | [
"Apache-2.0"
] | 2 | 2021-11-08T16:39:56.000Z | 2022-01-20T14:47:29.000Z | xcc/util.py | BastianZim/xanadu-cloud-client | 3a2d9d5373d90339a1047ee939bacef1bd4019ed | [
"Apache-2.0"
] | 2 | 2021-12-01T19:07:05.000Z | 2022-01-20T14:26:47.000Z | """
This module contains utilities which are shared between other modules.
"""
from typing import Any, Callable
class cached_property: # pylint: disable=invalid-name
"""Descriptor that transforms a class method into a property whose value is
computed once and then cached for subsequent accesses.
Args:
... | 31.191489 | 79 | 0.645975 |
from typing import Any, Callable
class cached_property:
def __init__(self, func: Callable[[Any], Any]) -> None:
self.func = func
self.caches = {}
self.__doc__ = func.__doc__
def __get__(self, instance: Any, _) -> Any:
if instance is None:
return self
... | true | true |
f73187898e8bb312c2b27b9f5d0d2fa9a2a19d87 | 79,267 | py | Python | flaml/model.py | rserran/FLAML | 7d6822aa40883550e72c4ee24adb765c6e937ce7 | [
"MIT"
] | null | null | null | flaml/model.py | rserran/FLAML | 7d6822aa40883550e72c4ee24adb765c6e937ce7 | [
"MIT"
] | null | null | null | flaml/model.py | rserran/FLAML | 7d6822aa40883550e72c4ee24adb765c6e937ce7 | [
"MIT"
] | null | null | null | # !
# * Copyright (c) FLAML authors. All rights reserved.
# * Licensed under the MIT License. See LICENSE file in the
# * project root for license information.
from contextlib import contextmanager
from functools import partial
import signal
import os
from typing import Callable, List
import numpy as np
im... | 36.646787 | 144 | 0.541121 | from contextlib import contextmanager
from functools import partial
import signal
import os
from typing import Callable, List
import numpy as np
import time
from sklearn.ensemble import RandomForestRegressor, RandomForestClassifier
from sklearn.ensemble import ExtraTreesRegressor, ExtraTreesClassifier
from skl... | true | true |
f731890bb291e3decda86f604a2ae15b9cc3c857 | 3,892 | py | Python | fishpi/ui/camera_view.py | FishPi/FishPi-POCV---Command---Control | 6df8e9db29c1b4769ddedb3a89a21fadae260709 | [
"BSD-2-Clause"
] | 18 | 2015-01-17T17:03:07.000Z | 2020-10-17T06:38:26.000Z | fishpi/ui/camera_view.py | FishPi/FishPi-POCV---Command---Control | 6df8e9db29c1b4769ddedb3a89a21fadae260709 | [
"BSD-2-Clause"
] | null | null | null | fishpi/ui/camera_view.py | FishPi/FishPi-POCV---Command---Control | 6df8e9db29c1b4769ddedb3a89a21fadae260709 | [
"BSD-2-Clause"
] | 9 | 2015-02-14T01:42:46.000Z | 2019-08-26T20:24:36.000Z | #!/usr/bin/python
#
# FishPi - An autonomous drop in the ocean
#
# Simple viewer for onboard camera
#
import argparse
import io
import sys
import socket
import struct
# from StringIO import StringIO
import wx
class CameraPanel(wx.Panel):
def __init__(self, parent, server, port=8001, enabled=True):
wx.P... | 34.442478 | 79 | 0.591213 |
import argparse
import io
import sys
import socket
import struct
import wx
class CameraPanel(wx.Panel):
def __init__(self, parent, server, port=8001, enabled=True):
wx.Panel.__init__(self, parent,
size=(320, 240), style=wx.SUNKEN_BORDER)
self.enabled = enabled
if self.enable... | false | true |
f7318945e70a68298c48631812fa81322c407bc9 | 12,916 | py | Python | env/lib/python3.6/site-packages/nibabel/tests/test_image_load_save.py | Raniac/NEURO-LEARN | 3c3acc55de8ba741e673063378e6cbaf10b64c7a | [
"Apache-2.0"
] | 8 | 2019-05-29T09:38:30.000Z | 2021-01-20T03:36:59.000Z | env/lib/python3.6/site-packages/nibabel/tests/test_image_load_save.py | Raniac/neurolearn_dev | 3c3acc55de8ba741e673063378e6cbaf10b64c7a | [
"Apache-2.0"
] | 12 | 2021-03-09T03:01:16.000Z | 2022-03-11T23:59:36.000Z | env/lib/python3.6/site-packages/nibabel/tests/test_image_load_save.py | Raniac/NEURO-LEARN | 3c3acc55de8ba741e673063378e6cbaf10b64c7a | [
"Apache-2.0"
] | 1 | 2020-07-17T12:49:49.000Z | 2020-07-17T12:49:49.000Z | # emacs: -*- mode: python-mode; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the NiBabel package for the
# copyright and license terms.
#
### ### ### #... | 38.440476 | 79 | 0.650743 | from __future__ import division, print_function, absolute_import
from io import BytesIO
import shutil
from os.path import dirname, join as pjoin
from tempfile import mkdtemp
import numpy as np
from .. import analyze as ana
from .. import spm99analyze as spm99
from .. import spm2analyze as spm2
from .. import nifti1 ... | true | true |
f7318a7c9b9961d14143aebdcada5b709c5812c1 | 2,945 | py | Python | tests/integration/qbs/test_qbs_submission_data.py | nealedj/eq-survey-runner | b8e6cddae6068f6c8fd60e21d31d58aaa79bbb34 | [
"MIT"
] | null | null | null | tests/integration/qbs/test_qbs_submission_data.py | nealedj/eq-survey-runner | b8e6cddae6068f6c8fd60e21d31d58aaa79bbb34 | [
"MIT"
] | 1 | 2018-11-05T12:00:51.000Z | 2018-11-05T12:00:51.000Z | tests/integration/qbs/test_qbs_submission_data.py | nealedj/eq-survey-runner | b8e6cddae6068f6c8fd60e21d31d58aaa79bbb34 | [
"MIT"
] | null | null | null | from tests.integration.integration_test_case import IntegrationTestCase
class TestQbsSubmissionData(IntegrationTestCase):
def test_submission_data_2_0001(self):
self.submission_data('2', '0001')
def submission_data(self, eq_id, form_type_id):
self.launchSurvey(eq_id, form_type_id, roles=['dum... | 38.75 | 84 | 0.529372 | from tests.integration.integration_test_case import IntegrationTestCase
class TestQbsSubmissionData(IntegrationTestCase):
def test_submission_data_2_0001(self):
self.submission_data('2', '0001')
def submission_data(self, eq_id, form_type_id):
self.launchSurvey(eq_id, form_type_id, roles=['dum... | true | true |
f7318bf8ab84bb950ae4d28f761bd4399b07f385 | 46,765 | py | Python | src/transformers/configuration_utils.py | elusenji/transformers | af14c61973effd8b8077ac61b3f24bdd4a632f25 | [
"Apache-2.0"
] | 3 | 2022-01-15T08:06:07.000Z | 2022-03-10T07:13:18.000Z | src/transformers/configuration_utils.py | arron1227/transformers | b18dfd95e1f60ae65a959a7b255fc06522170d1b | [
"Apache-2.0"
] | null | null | null | src/transformers/configuration_utils.py | arron1227/transformers | b18dfd95e1f60ae65a959a7b255fc06522170d1b | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a cop... | 50.284946 | 129 | 0.653459 |
import copy
import json
import os
import re
import warnings
from typing import Any, Dict, List, Optional, Tuple, Union
from packaging import version
from requests import HTTPError
from . import __version__
from .dynamic_module_utils import custom_object_save
from .utils import (
CONFIG_NAME,
HUGGINGFACE_CO... | true | true |
f7318c2b9fdaa9f536243ae29bdfe008ac0eb2a0 | 22,340 | py | Python | addons/io_scene_gltf2/blender/exp/gltf2_blender_extract.py | inaber0420/glTF-Modo-IO | 57f99aee4e9b6177d25b465b87d731b54a625532 | [
"Apache-2.0"
] | 1,084 | 2018-07-14T07:09:50.000Z | 2022-03-30T16:34:05.000Z | addons/io_scene_gltf2/blender/exp/gltf2_blender_extract.py | inaber0420/glTF-Modo-IO | 57f99aee4e9b6177d25b465b87d731b54a625532 | [
"Apache-2.0"
] | 1,375 | 2018-07-13T22:09:24.000Z | 2022-03-31T00:36:36.000Z | addons/io_scene_gltf2/blender/exp/gltf2_blender_extract.py | inaber0420/glTF-Modo-IO | 57f99aee4e9b6177d25b465b87d731b54a625532 | [
"Apache-2.0"
] | 235 | 2018-07-13T22:04:28.000Z | 2022-03-30T09:15:53.000Z | # Copyright 2018-2021 The glTF-Blender-IO authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 37.35786 | 120 | 0.616025 |
import numpy as np
from mathutils import Vector
from . import gltf2_blender_export_keys
from ...io.com.gltf2_io_debug import print_console
from io_scene_gltf2.blender.exp import gltf2_blender_gather_skins
def extract_primitives(glTF, blender_mesh, library, blender_object, blender_vertex_groups, modifiers, export_se... | true | true |
f7318c381216a7a0a5e30f0ca35e0f3c326d7ead | 184 | py | Python | beecrowd exercises/beecrowd-1145.py | pachecosamuel/Python-Exercises | de542536dd1a2bc0ad27e81824713cda8ad34054 | [
"MIT"
] | null | null | null | beecrowd exercises/beecrowd-1145.py | pachecosamuel/Python-Exercises | de542536dd1a2bc0ad27e81824713cda8ad34054 | [
"MIT"
] | null | null | null | beecrowd exercises/beecrowd-1145.py | pachecosamuel/Python-Exercises | de542536dd1a2bc0ad27e81824713cda8ad34054 | [
"MIT"
] | null | null | null | n1,n2 = list(map(int,input().split()))
cont = 1
for i in range(1,(int((n2/n1))+1)):
r = ""
for y in range(n1):
r += str(cont) + " "
cont += 1
print(r[:-1])
| 20.444444 | 38 | 0.451087 | n1,n2 = list(map(int,input().split()))
cont = 1
for i in range(1,(int((n2/n1))+1)):
r = ""
for y in range(n1):
r += str(cont) + " "
cont += 1
print(r[:-1])
| true | true |
f7318c8d58133c98fa8052706364e5c9c4e4f7bb | 116 | py | Python | ComStream/tf_idf/__init__.py | alimpfard/ComStream | 1bfde3a01ba0b996b4c41e0e9112089618789469 | [
"MIT"
] | null | null | null | ComStream/tf_idf/__init__.py | alimpfard/ComStream | 1bfde3a01ba0b996b4c41e0e9112089618789469 | [
"MIT"
] | null | null | null | ComStream/tf_idf/__init__.py | alimpfard/ComStream | 1bfde3a01ba0b996b4c41e0e9112089618789469 | [
"MIT"
] | null | null | null | from . import Agent
from . import Coordinator
from . import DataManager
from . import DataPoint
from . import Utils
| 19.333333 | 25 | 0.784483 | from . import Agent
from . import Coordinator
from . import DataManager
from . import DataPoint
from . import Utils
| true | true |
f7318c9eae78d9ecd4097a5f77c09245d4f5b3b0 | 14,635 | py | Python | appmetrics/statistics.py | avalente/appmetrics | 366fc7e1ca897e49a2227cbfa43bfa02a47f1acc | [
"Apache-2.0"
] | 60 | 2015-01-19T05:32:32.000Z | 2021-06-08T07:35:02.000Z | appmetrics/statistics.py | alexKeleon/appmetrics | 366fc7e1ca897e49a2227cbfa43bfa02a47f1acc | [
"Apache-2.0"
] | 6 | 2015-03-02T19:25:02.000Z | 2021-03-27T17:26:07.000Z | appmetrics/statistics.py | alexKeleon/appmetrics | 366fc7e1ca897e49a2227cbfa43bfa02a47f1acc | [
"Apache-2.0"
] | 12 | 2015-01-19T05:04:14.000Z | 2020-09-08T07:49:54.000Z | ## Module statistics.py
##
## Copyright (c) 2014 Antonio Valente <y3sman@gmail.com>
##
## 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
... | 28.362403 | 99 | 0.624804 |
from __future__ import division
import collections
import math
import operator
import functools
from fractions import Fraction
from decimal import Decimal
from .exceptions import StatisticsError
from .py3comp import xrange, iteritems
def isfinite(n):
return not (math.isinf(n) or math.isnan(n))
def sum(da... | true | true |
f7318cbf69b4247d05d82297d5c1cf2c37526fa4 | 6,137 | py | Python | lavaplayer/websocket.py | xArty4/lavaplayer | 1fae7c74e5e3c1eaf45b06fc05fc5fb16a2e4d3c | [
"MIT"
] | null | null | null | lavaplayer/websocket.py | xArty4/lavaplayer | 1fae7c74e5e3c1eaf45b06fc05fc5fb16a2e4d3c | [
"MIT"
] | null | null | null | lavaplayer/websocket.py | xArty4/lavaplayer | 1fae7c74e5e3c1eaf45b06fc05fc5fb16a2e4d3c | [
"MIT"
] | null | null | null | import asyncio
import aiohttp
import logging
from lavaplayer.exceptions import NodeError
from .objects import (
Info,
PlayerUpdateEvent,
TrackStartEvent,
TrackEndEvent,
TrackExceptionEvent,
TrackStuckEvent,
WebSocketClosedEvent,
)
from .emitter import Emitter
import typing as t
if t.TYPE_CH... | 40.111111 | 175 | 0.570311 | import asyncio
import aiohttp
import logging
from lavaplayer.exceptions import NodeError
from .objects import (
Info,
PlayerUpdateEvent,
TrackStartEvent,
TrackEndEvent,
TrackExceptionEvent,
TrackStuckEvent,
WebSocketClosedEvent,
)
from .emitter import Emitter
import typing as t
if t.TYPE_CH... | true | true |
f7318d4e874e77b247071f0e8f618b2b791be9d7 | 629 | py | Python | skl2onnx/operator_converters/id_op.py | xiaowuhu/sklearn-onnx | e85674a67a0a043e19c2ffe181e5d31eca8ce40b | [
"Apache-2.0"
] | 323 | 2018-12-18T20:23:19.000Z | 2022-03-25T09:47:31.000Z | skl2onnx/operator_converters/id_op.py | xiaowuhu/sklearn-onnx | e85674a67a0a043e19c2ffe181e5d31eca8ce40b | [
"Apache-2.0"
] | 408 | 2019-01-02T12:16:10.000Z | 2022-03-21T14:01:28.000Z | skl2onnx/operator_converters/id_op.py | xiaowuhu/sklearn-onnx | e85674a67a0a043e19c2ffe181e5d31eca8ce40b | [
"Apache-2.0"
] | 70 | 2018-12-20T19:36:07.000Z | 2022-03-14T06:41:36.000Z | # SPDX-License-Identifier: Apache-2.0
from ..common._apply_operation import apply_identity
from ..common._registration import register_converter
from ..common._topology import Scope, Operator
from ..common._container import ModelComponentContainer
def convert_sklearn_identity(scope: Scope, operator: Operator,
... | 33.105263 | 66 | 0.761526 |
from ..common._apply_operation import apply_identity
from ..common._registration import register_converter
from ..common._topology import Scope, Operator
from ..common._container import ModelComponentContainer
def convert_sklearn_identity(scope: Scope, operator: Operator,
container: Mod... | true | true |
f7318d62eadf54fe70b5a57ab76350ff07135c26 | 177 | py | Python | tests/cases/core/layer3_pubsub/rpc/timeout/bad_call.py | AaronJGaut/pyspoke | 37bbe8b42c5abe129a3736b255c8a2ee17a4fb59 | [
"MIT"
] | null | null | null | tests/cases/core/layer3_pubsub/rpc/timeout/bad_call.py | AaronJGaut/pyspoke | 37bbe8b42c5abe129a3736b255c8a2ee17a4fb59 | [
"MIT"
] | null | null | null | tests/cases/core/layer3_pubsub/rpc/timeout/bad_call.py | AaronJGaut/pyspoke | 37bbe8b42c5abe129a3736b255c8a2ee17a4fb59 | [
"MIT"
] | null | null | null | import spoke
try:
spoke.call("junk", None, timeout=2)
except TimeoutError:
print("Got expected TimeoutError")
else:
raise TestFailure("Didn't get a TimeoutError")
| 17.7 | 50 | 0.711864 | import spoke
try:
spoke.call("junk", None, timeout=2)
except TimeoutError:
print("Got expected TimeoutError")
else:
raise TestFailure("Didn't get a TimeoutError")
| true | true |
f7318e0ce7bdc535165b2bde29c259ad0a74e64c | 9,150 | py | Python | tests/providers/test_internet.py | shirakia/faker | 4eb4ef24f5edbcbadd38f941025b671f5b6ebe60 | [
"MIT"
] | 1 | 2019-01-16T14:02:54.000Z | 2019-01-16T14:02:54.000Z | tests/providers/test_internet.py | shirakia/faker | 4eb4ef24f5edbcbadd38f941025b671f5b6ebe60 | [
"MIT"
] | null | null | null | tests/providers/test_internet.py | shirakia/faker | 4eb4ef24f5edbcbadd38f941025b671f5b6ebe60 | [
"MIT"
] | 1 | 2019-11-07T03:33:43.000Z | 2019-11-07T03:33:43.000Z | # coding=utf-8
from __future__ import unicode_literals
from itertools import cycle
import unittest
import mock
import pytest
import six
from email_validator import validate_email
from faker import Faker
from faker.providers.person.ja_JP import Provider as JaProvider
from faker.utils import text
class TestIntern... | 31.6609 | 80 | 0.628962 |
from __future__ import unicode_literals
from itertools import cycle
import unittest
import mock
import pytest
import six
from email_validator import validate_email
from faker import Faker
from faker.providers.person.ja_JP import Provider as JaProvider
from faker.utils import text
class TestInternetProvider(unit... | true | true |
f7318f9b6f7017b7889c28a18c24f5841345d651 | 2,324 | py | Python | project-chat/chatApp/migrations/0001_initial.py | Torkvamedo/smx | a5aef4f430f56ac67100c505902f55e18fba5978 | [
"Unlicense"
] | null | null | null | project-chat/chatApp/migrations/0001_initial.py | Torkvamedo/smx | a5aef4f430f56ac67100c505902f55e18fba5978 | [
"Unlicense"
] | null | null | null | project-chat/chatApp/migrations/0001_initial.py | Torkvamedo/smx | a5aef4f430f56ac67100c505902f55e18fba5978 | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-06-17 19:23
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Crea... | 38.098361 | 144 | 0.577883 | from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Ban',
fields=[
('i... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.