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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c04d0e008f3b286f1bfb5878438d76897e06074 | 8,377 | py | Python | gcnn/gcnn_model.py | andrea-silvi/pointnet.pytorch | 6aa48c12f6b507dedb3af716c61310ac574aea91 | [
"MIT"
] | null | null | null | gcnn/gcnn_model.py | andrea-silvi/pointnet.pytorch | 6aa48c12f6b507dedb3af716c61310ac574aea91 | [
"MIT"
] | null | null | null | gcnn/gcnn_model.py | andrea-silvi/pointnet.pytorch | 6aa48c12f6b507dedb3af716c61310ac574aea91 | [
"MIT"
] | 1 | 2021-09-24T14:58:46.000Z | 2021-09-24T14:58:46.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@Author: Yue Wang
@Contact: yuewangx@mit.edu
@File: model.py
@Time: 2018/10/13 6:35 PM
"""
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
def knn(x, k):
inner = -2 * torch.matmul(x.transpose(2, 1), x)
xx = torch.sum(x ** 2,... | 36.107759 | 122 | 0.588994 |
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
def knn(x, k):
inner = -2 * torch.matmul(x.transpose(2, 1), x)
xx = torch.sum(x ** 2, dim=1, keepdim=True)
pairwise_distance = -xx - inner - xx.transpose(2, 1)
idx = pairwise_distance.topk(k=k, dim=-1)[1] return ... | true | true |
1c04d21cf3e40ed334d539216906677cfb17061c | 4,053 | py | Python | editor/lib/juma/core/Project.py | RazielSun/juma-editor | 125720f7386f9f0a4cd3466a45c883d6d6020e33 | [
"MIT"
] | null | null | null | editor/lib/juma/core/Project.py | RazielSun/juma-editor | 125720f7386f9f0a4cd3466a45c883d6d6020e33 | [
"MIT"
] | null | null | null | editor/lib/juma/core/Project.py | RazielSun/juma-editor | 125720f7386f9f0a4cd3466a45c883d6d6020e33 | [
"MIT"
] | 1 | 2022-03-31T00:50:23.000Z | 2022-03-31T00:50:23.000Z | #!/usr/bin/env python
import logging
import sys
import imp
import os
import os.path
import re
import shutil
import hashlib
import time
import signals
import jsonHelper
from cache import CacheManager
from asset import AssetLibrary
_PROJECT_LUA_DIR = 'lua'
_PROJECT_ASSETS_DIR = 'assets'
_PROJECT_EDITOR_DIR ... | 25.33125 | 110 | 0.641007 |
import logging
import sys
import imp
import os
import os.path
import re
import shutil
import hashlib
import time
import signals
import jsonHelper
from cache import CacheManager
from asset import AssetLibrary
_PROJECT_LUA_DIR = 'lua'
_PROJECT_ASSETS_DIR = 'assets'
_PROJECT_EDITOR_DIR = 'editor'
_PROJECT_I... | false | true |
1c04d3bbfab001a8eca034bd7b835aad9bdf8e0f | 4,703 | py | Python | core/actorClasses/imageAnalyse.py | grzes5003/LicensePlateRec | c051db15000e8165aeaf75bed8bc1bdb32914576 | [
"MIT"
] | null | null | null | core/actorClasses/imageAnalyse.py | grzes5003/LicensePlateRec | c051db15000e8165aeaf75bed8bc1bdb32914576 | [
"MIT"
] | 1 | 2021-01-03T15:50:56.000Z | 2021-01-09T18:28:46.000Z | core/actorClasses/imageAnalyse.py | grzes5003/LicensePlateRec | c051db15000e8165aeaf75bed8bc1bdb32914576 | [
"MIT"
] | null | null | null | import logging
import os
import random
import sys
import threading
import time
from abc import abstractmethod, ABC
from pathlib import Path
import cv2
from core.dataClasses.LicensePlate import LicensePlate
from core.dataClasses.frame import Frame
from openalpr_x86.python.build.lib.openalpr.openalpr import Alpr
# mod... | 36.457364 | 112 | 0.654476 | import logging
import os
import random
import sys
import threading
import time
from abc import abstractmethod, ABC
from pathlib import Path
import cv2
from core.dataClasses.LicensePlate import LicensePlate
from core.dataClasses.frame import Frame
from openalpr_x86.python.build.lib.openalpr.openalpr import Alpr
ROOT_... | true | true |
1c04d4e87cde2784aea492c00550d76824f2a0b6 | 26,587 | py | Python | scripts/pytorch_lightning_training_script/train.py | atypon/specter | bc1ee723167cf1dbf599603e09539c1823f26c17 | [
"Apache-2.0"
] | null | null | null | scripts/pytorch_lightning_training_script/train.py | atypon/specter | bc1ee723167cf1dbf599603e09539c1823f26c17 | [
"Apache-2.0"
] | null | null | null | scripts/pytorch_lightning_training_script/train.py | atypon/specter | bc1ee723167cf1dbf599603e09539c1823f26c17 | [
"Apache-2.0"
] | null | null | null | # basic python packages
import json
import pickle
from typing import Dict
import argparse
from argparse import Namespace
import glob
import random
import numpy as np
import itertools
import logging
logger = logging.getLogger(__name__)
# pytorch packages
import torch
import torch.nn as nn
import torch.nn.functional as ... | 44.311667 | 159 | 0.62256 | import json
import pickle
from typing import Dict
import argparse
from argparse import Namespace
import glob
import random
import numpy as np
import itertools
import logging
logger = logging.getLogger(__name__)
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import DataLoader, ... | true | true |
1c04d7807e753177a12c97665b549db21962672f | 1,718 | py | Python | RL/Oanda/READONLY-oanda-api-v20/oandapyV20 - Copy/definitions/orders.py | Poppins001/Projects | 386b741c2a8361289d73af658c8c6779ec8315b2 | [
"MIT"
] | 1 | 2018-06-01T14:40:49.000Z | 2018-06-01T14:40:49.000Z | RL/Oanda/READONLY-oanda-api-v20/oandapyV20 - Copy/definitions/orders.py | Poppins001/Projects | 386b741c2a8361289d73af658c8c6779ec8315b2 | [
"MIT"
] | null | null | null | RL/Oanda/READONLY-oanda-api-v20/oandapyV20 - Copy/definitions/orders.py | Poppins001/Projects | 386b741c2a8361289d73af658c8c6779ec8315b2 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Order related definitions."""
definitions = {
"OrderType": {
"MARKET": "A Market Order",
"LIMIT": "A Limit Order",
"STOP": "A Stop Order",
"MARKET_IF_TOUCHED": "A Market-if-touched Order",
"TAKE_PROFIT": "A Take Profit Order",
"STOP_LOSS": ... | 41.902439 | 78 | 0.573341 |
definitions = {
"OrderType": {
"MARKET": "A Market Order",
"LIMIT": "A Limit Order",
"STOP": "A Stop Order",
"MARKET_IF_TOUCHED": "A Market-if-touched Order",
"TAKE_PROFIT": "A Take Profit Order",
"STOP_LOSS": "A Stop Loss Order",
"TRAILING_STOP_LOSS": "A Tra... | true | true |
1c04d7889871300cf678937b9a4da13e22146e6b | 2,477 | py | Python | python33_extra (decorators with arguements).py | Ahammmad-Shawki8/AS8-repository | fb0d1663c888c0bec0b1013b49778861117b6398 | [
"MIT"
] | 11 | 2020-09-08T12:18:50.000Z | 2021-11-08T11:22:44.000Z | python33_extra (decorators with arguements).py | Ahammmad-Shawki8/AS8-repository | fb0d1663c888c0bec0b1013b49778861117b6398 | [
"MIT"
] | 5 | 2021-03-02T13:18:38.000Z | 2021-04-24T03:30:01.000Z | python33_extra (decorators with arguements).py | Ahammmad-Shawki8/AS8-repository | fb0d1663c888c0bec0b1013b49778861117b6398 | [
"MIT"
] | 4 | 2020-08-17T12:23:12.000Z | 2021-03-08T17:52:33.000Z | # extra
# decorators with arguments
# it is a very important concept that we will see time to time.
# for example, if we see the hello world application from the flask website,
# we can see here, that there routes are defined with the app.route decorator.
# and the string get passed in is the url path.
# here we have... | 55.044444 | 136 | 0.759386 |
def prefix_decorator(prefix):
def decorator_function(original_function): def wrapper_function(*args,**kwargs): print(prefix,"Executed Before", original_function.__name__) result=original_function(*args,**kwargs) print(prefix,"Executed After", original_function.__name__,"\n... | true | true |
1c04d8a4a7336d30d2ba52e1b72559e3699dcbde | 4,487 | py | Python | tests/test_skills/test_tasks.py | lrahmani/agents-aea | 9bd1d51530fc21bf41b5adea031cda19a94b048b | [
"Apache-2.0"
] | null | null | null | tests/test_skills/test_tasks.py | lrahmani/agents-aea | 9bd1d51530fc21bf41b5adea031cda19a94b048b | [
"Apache-2.0"
] | null | null | null | tests/test_skills/test_tasks.py | lrahmani/agents-aea | 9bd1d51530fc21bf41b5adea031cda19a94b048b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2019 Fetch.AI Limited
#
# 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 ... | 32.280576 | 80 | 0.625585 |
from unittest import TestCase, mock
from aea.skills.tasks import Task, TaskManager, init_worker
def _raise_exception(self, *args, **kwargs):
raise Exception()
class TaskTestCase(TestCase):
def test_call_positive(self):
obj = Task()
obj.setup = mock.Mock()
obj.execute = mock.Mock(... | true | true |
1c04d95f068318604f049783fecf798cc70f4839 | 3,233 | py | Python | tccli/utils.py | ivandksun/tencentcloud-cli-intl-en | 41b84e339918961b8bc92f7498e56347d21e16d3 | [
"Apache-2.0"
] | null | null | null | tccli/utils.py | ivandksun/tencentcloud-cli-intl-en | 41b84e339918961b8bc92f7498e56347d21e16d3 | [
"Apache-2.0"
] | null | null | null | tccli/utils.py | ivandksun/tencentcloud-cli-intl-en | 41b84e339918961b8bc92f7498e56347d21e16d3 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import sys
import json
import time
import os
import tccli.options_define as options_define
PY2 = sys.version_info[0] == 2
class Utils(object):
@staticmethod
def try_to_json(data, k):
if k in data and data[k]:
try:
return json.loads(data[k])
... | 28.113043 | 86 | 0.485926 | import sys
import json
import time
import os
import tccli.options_define as options_define
PY2 = sys.version_info[0] == 2
class Utils(object):
@staticmethod
def try_to_json(data, k):
if k in data and data[k]:
try:
return json.loads(data[k])
except Exception:
... | true | true |
1c04da6124d3cbb276e990369c381879b6df307b | 5,011 | py | Python | examples/demo_mandelbrot.py | kanderso-nrel/pyopencl | 0ee2164ec65de9a4aa69e0c01e70aa66c3d989cb | [
"Apache-2.0"
] | 569 | 2015-02-04T15:54:21.000Z | 2022-03-28T13:44:29.000Z | examples/demo_mandelbrot.py | kanderso-nrel/pyopencl | 0ee2164ec65de9a4aa69e0c01e70aa66c3d989cb | [
"Apache-2.0"
] | 277 | 2016-11-08T11:05:12.000Z | 2022-03-31T11:48:08.000Z | examples/demo_mandelbrot.py | kanderso-nrel/pyopencl | 0ee2164ec65de9a4aa69e0c01e70aa66c3d989cb | [
"Apache-2.0"
] | 159 | 2015-01-19T10:07:00.000Z | 2022-03-15T16:48:41.000Z | # I found this example for PyCuda here:
# http://wiki.tiker.net/PyCuda/Examples/Mandelbrot
#
# An improved sequential/pure Python code was contributed
# by CRVSADER//KY <crusaderky@gmail.com>.
#
# I adapted it for PyOpenCL. Hopefully it is useful to someone.
# July 2010, HolgerRapp@gmx.net
#
# Original readme below the... | 27.532967 | 84 | 0.606266 |
# http://www.daniweb.com/code/snippet216851.html#
# with minor changes to move to numpy from the obsolete Numeric
import time
import numpy as np
import pyopencl as cl
from PIL import Image
# You can choose a calculation routine below (calc_fractal), uncomment
# one of the three lines to test the three variations... | true | true |
1c04db0d425e5d178854ae5c8465baf5dd2d8217 | 8,146 | py | Python | kedro/contrib/io/catalog_with_default/data_catalog_with_default.py | martwetzels/kedro | 25bf2dfc8af7b3fda7f5bb4e6c00f16b3768e2e9 | [
"Apache-2.0"
] | null | null | null | kedro/contrib/io/catalog_with_default/data_catalog_with_default.py | martwetzels/kedro | 25bf2dfc8af7b3fda7f5bb4e6c00f16b3768e2e9 | [
"Apache-2.0"
] | null | null | null | kedro/contrib/io/catalog_with_default/data_catalog_with_default.py | martwetzels/kedro | 25bf2dfc8af7b3fda7f5bb4e6c00f16b3768e2e9 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018-2019 QuantumBlack Visual Analytics Limited
#
# 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
#
# THE SOFTWARE IS PROVIDED "AS IS"... | 38.065421 | 81 | 0.623742 |
from typing import Any, Callable, Dict, Optional
from warnings import warn
from kedro.io import AbstractDataSet, DataCatalog
from kedro.versioning import Journal
class DataCatalogWithDefault(DataCatalog):
def __init__(
self,
data_sets: Dict[str, AbstractDataSet] = None,
default: Callabl... | true | true |
1c04db4cdf03085f011d48f2d29581b037cc3174 | 41,202 | py | Python | install/app_store/tk-multi-shotgunpanel/v1.4.8/python/app/dialog.py | JoanAzpeitia/lp_sg | e0ee79555e419dd2ae3a5f31e5515b3f40b22a62 | [
"MIT"
] | null | null | null | install/app_store/tk-multi-shotgunpanel/v1.4.8/python/app/dialog.py | JoanAzpeitia/lp_sg | e0ee79555e419dd2ae3a5f31e5515b3f40b22a62 | [
"MIT"
] | null | null | null | install/app_store/tk-multi-shotgunpanel/v1.4.8/python/app/dialog.py | JoanAzpeitia/lp_sg | e0ee79555e419dd2ae3a5f31e5515b3f40b22a62 | [
"MIT"
] | 1 | 2020-02-15T10:42:56.000Z | 2020-02-15T10:42:56.000Z | # Copyright (c) 2015 Shotgun Software Inc.
#
# CONFIDENTIAL AND PROPRIETARY
#
# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit
# Source Code License included in this distribution package. See LICENSE.
# By accessing, using, copying or modifying this work you indicate your
# agreement to t... | 41.787018 | 111 | 0.622567 |
import sgtk
import pprint
from sgtk.platform.qt import QtCore, QtGui
from .ui.dialog import Ui_Dialog
from .shotgun_location import ShotgunLocation
from .delegate_list_item import ListItemDelegate
from .action_manager import ActionManager
from .model_entity_listing import SgEntityListingModel
from .model_version_lis... | false | true |
1c04dbe876a7932737d0f7fe67888ab17b0ea70f | 12,158 | py | Python | test/mappers/second_quantization/resources/bksf_lih.py | jschuhmac/qiskit-nature | b8b1181d951cf8fa76fe0db9e5ea192dad5fb186 | [
"Apache-2.0"
] | 1 | 2022-02-15T08:34:51.000Z | 2022-02-15T08:34:51.000Z | test/mappers/second_quantization/resources/bksf_lih.py | jschuhmac/qiskit-nature | b8b1181d951cf8fa76fe0db9e5ea192dad5fb186 | [
"Apache-2.0"
] | null | null | null | test/mappers/second_quantization/resources/bksf_lih.py | jschuhmac/qiskit-nature | b8b1181d951cf8fa76fe0db9e5ea192dad5fb186 | [
"Apache-2.0"
] | null | null | null | # This code is part of Qiskit.
#
# (C) Copyright IBM 2022.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... | 31.661458 | 96 | 0.473762 |
import numpy
from qiskit.quantum_info import PauliList, SparsePauliOp
from qiskit_nature.operators.second_quantization import FermionicOp
FERMIONIC_HAMILTONIAN = FermionicOp(
[
("+-I+-I", (0.013063981998607477 + 0j)),
("+-I-+I", (-0.013063981998607472 + 0j)),
("+-IIII", (0.04857959952036... | true | true |
1c04dc59ed9d3c9f9966b7b2c1ca52e2562ee288 | 539 | py | Python | manage.py | insung151/Pwannar | 9f0be39e763dfc709a4b43a2498a95a19bfa435f | [
"MIT"
] | null | null | null | manage.py | insung151/Pwannar | 9f0be39e763dfc709a4b43a2498a95a19bfa435f | [
"MIT"
] | 4 | 2018-02-14T11:58:51.000Z | 2018-02-14T14:03:16.000Z | manage.py | insung151/Pwannar | 9f0be39e763dfc709a4b43a2498a95a19bfa435f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "Pwannar.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are ... | 33.6875 | 73 | 0.686456 | import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "Pwannar.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installe... | true | true |
1c04dde6e9a74b8bd1c1c70f8d0c07d57189d54a | 80,967 | py | Python | include/ClientGUILogin.py | DonaldTsang/hydrus | 1ffd13469c0ea98ea78961ab377aff1c6325379b | [
"WTFPL"
] | null | null | null | include/ClientGUILogin.py | DonaldTsang/hydrus | 1ffd13469c0ea98ea78961ab377aff1c6325379b | [
"WTFPL"
] | null | null | null | include/ClientGUILogin.py | DonaldTsang/hydrus | 1ffd13469c0ea98ea78961ab377aff1c6325379b | [
"WTFPL"
] | null | null | null | from . import ClientConstants as CC
from . import ClientData
from . import ClientDefaults
from . import ClientGUICommon
from . import ClientGUIDialogs
from . import ClientGUIDialogsQuick
from . import ClientGUIMenus
from . import ClientGUIControls
from . import ClientGUIFunctions
from . import ClientGUIListBoxes
from .... | 37.817375 | 282 | 0.569677 | from . import ClientConstants as CC
from . import ClientData
from . import ClientDefaults
from . import ClientGUICommon
from . import ClientGUIDialogs
from . import ClientGUIDialogsQuick
from . import ClientGUIMenus
from . import ClientGUIControls
from . import ClientGUIFunctions
from . import ClientGUIListBoxes
from .... | true | true |
1c04ded50fb01e0477c00ee9ff88be4eceb8c348 | 2,231 | py | Python | downloader.py | DisenWang/kaggle-s18 | 83d70d48b46c2615fea46808537abc68671855c5 | [
"MIT"
] | null | null | null | downloader.py | DisenWang/kaggle-s18 | 83d70d48b46c2615fea46808537abc68671855c5 | [
"MIT"
] | null | null | null | downloader.py | DisenWang/kaggle-s18 | 83d70d48b46c2615fea46808537abc68671855c5 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import io
import os
import sys
import json
import urllib3
import multiprocessing
from PIL import Image
from tqdm import tqdm
from urllib3.util import Retry
urllib3.disable_warnings(urllib3.exceptions.Insecure... | 30.986111 | 89 | 0.689377 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import io
import os
import sys
import json
import urllib3
import multiprocessing
from PIL import Image
from tqdm import tqdm
from urllib3.util import Retry
urllib3.disable_warnings(urllib3.exceptions.Insecure... | true | true |
1c04df162a9853be6ab6899802ebff4bd2a77ad8 | 1,341 | py | Python | scripts/lg_ctrl.py | m-wichmann/kodi_addons | 3a1a8dca4927560ed1d9425b08c77c3db90b019c | [
"MIT"
] | null | null | null | scripts/lg_ctrl.py | m-wichmann/kodi_addons | 3a1a8dca4927560ed1d9425b08c77c3db90b019c | [
"MIT"
] | null | null | null | scripts/lg_ctrl.py | m-wichmann/kodi_addons | 3a1a8dca4927560ed1d9425b08c77c3db90b019c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import re
import serial
class TvControl(object):
# Get Power "ka 00 FF\r"
# Off "ka 00 00\r"
# On "ka 00 01\r"
# Get Input "xb 00 FF\r"
# Input HDMI1 "xb 00 90\r"
# Input HDMI2 "xb 00 91\r"
# Input HDMI3 "xb 00 92\r"
# Input A... | 23.946429 | 61 | 0.529456 |
import re
import serial
class TvControl(object):
INPUT_NONE = None
INPUT_HDMI1 = 0x90
INPUT_HDMI2 = 0x91
INPUT_HDMI3 = 0x92
INPUT_AV2 = 0x21
def __init__(self, tty_dev='/dev/ttyUSB0'):
self.ser = serial.Serial(tty_dev, timeout=1.0)
def __deinit__... | true | true |
1c04dfab3677ec4f2d31de233f51a5544b2d588a | 8,078 | py | Python | maxwell_faker/bootstrap.py | movio/maxwell-faker | 3c38128a82f0a589afab3d35d1f9461d498474ad | [
"MIT"
] | 2 | 2016-03-21T04:59:16.000Z | 2016-03-22T01:59:39.000Z | maxwell_faker/bootstrap.py | movio/maxwell-faker | 3c38128a82f0a589afab3d35d1f9461d498474ad | [
"MIT"
] | 5 | 2016-03-21T12:26:58.000Z | 2016-11-15T14:29:02.000Z | maxwell_faker/bootstrap.py | movio/maxwell-faker | 3c38128a82f0a589afab3d35d1f9461d498474ad | [
"MIT"
] | 2 | 2016-10-19T20:10:41.000Z | 2019-10-03T21:41:14.000Z | # -*- coding: utf-8 -*-
import sys
import json
import yaml
import argparse
import bruce
from time import time
from config import validate_config
from utils import usage, java_string_hashcode
from row_generator import RowGenerator
from kafka import KafkaProducer
UPDATE_PERIOD_MILLIS = 250
DISPLAY_PROGRESS_PERIOD_MILL... | 35.902222 | 112 | 0.671082 |
import sys
import json
import yaml
import argparse
import bruce
from time import time
from config import validate_config
from utils import usage, java_string_hashcode
from row_generator import RowGenerator
from kafka import KafkaProducer
UPDATE_PERIOD_MILLIS = 250
DISPLAY_PROGRESS_PERIOD_MILLIS = 250
DISPLAY_PROGRES... | false | true |
1c04dfb7bf757477d134cc7caa223ab47d0800ba | 6,790 | py | Python | youtube_dl/extractor/svt.py | rajkotraja/YTDownloader | 01a0c511ebfa56699c1f58164c679b24f7972681 | [
"Unlicense"
] | null | null | null | youtube_dl/extractor/svt.py | rajkotraja/YTDownloader | 01a0c511ebfa56699c1f58164c679b24f7972681 | [
"Unlicense"
] | null | null | null | youtube_dl/extractor/svt.py | rajkotraja/YTDownloader | 01a0c511ebfa56699c1f58164c679b24f7972681 | [
"Unlicense"
] | null | null | null | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
determine_ext,
dict_get,
int_or_none,
try_get,
)
class SVTBaseIE(InfoExtractor):
def _extract_video(self, video_info, video_id):
formats = []
for vr in video_... | 36.31016 | 133 | 0.537703 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
determine_ext,
dict_get,
int_or_none,
try_get,
)
class SVTBaseIE(InfoExtractor):
def _extract_video(self, video_info, video_id):
formats = []
for vr in video_info['videoRefer... | true | true |
1c04e2168e2bb050517eb9e52096d477e85b4c9b | 1,692 | py | Python | studies/migrations/0064_upgrade_django_1_11_to_2_1.py | manybabies/MBAH-LookIt-API | 18474ceac3dcc8365a5559cf84e9f460671993f5 | [
"MIT"
] | 9 | 2018-06-26T17:15:27.000Z | 2021-11-21T17:19:01.000Z | studies/migrations/0064_upgrade_django_1_11_to_2_1.py | manybabies/MBAH-LookIt-API | 18474ceac3dcc8365a5559cf84e9f460671993f5 | [
"MIT"
] | 496 | 2018-02-19T19:18:24.000Z | 2022-03-31T17:01:16.000Z | studies/migrations/0064_upgrade_django_1_11_to_2_1.py | manybabies/MBAH-LookIt-API | 18474ceac3dcc8365a5559cf84e9f460671993f5 | [
"MIT"
] | 16 | 2018-07-06T23:35:39.000Z | 2021-11-21T17:52:58.000Z | # Generated by Django 3.0.5 on 2020-05-04 19:33
from django.conf import settings
from django.db import migrations
import project.fields.datetime_aware_jsonfield
import studies.models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
... | 31.333333 | 81 | 0.572695 |
from django.conf import settings
from django.db import migrations
import project.fields.datetime_aware_jsonfield
import studies.models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("accounts", "0046_catch-up-migrations-to-cur... | true | true |
1c04e21eef13c1a21e6868b25c9a618ba017b2f5 | 893 | py | Python | ggplot/scales/scale_y_discrete.py | ouseful-backup/ggplot | b5872f04f4e6ee47874eb66676b1d44375d005ef | [
"BSD-2-Clause"
] | 6 | 2016-10-06T08:37:45.000Z | 2019-12-09T06:52:28.000Z | ggplot/scales/scale_y_discrete.py | vannem/ggplot | 0f3774e6a645796b843d3ce77fb388958773338e | [
"BSD-2-Clause"
] | null | null | null | ggplot/scales/scale_y_discrete.py | vannem/ggplot | 0f3774e6a645796b843d3ce77fb388958773338e | [
"BSD-2-Clause"
] | 15 | 2015-12-15T05:49:39.000Z | 2021-04-17T09:47:48.000Z | from .scale import scale
from copy import deepcopy
class scale_y_discrete(scale):
"""
Scale y axis as discrete values
Parameters
----------
breaks: list
maps to ybreaks
labels: list, dict
maps to ytick_labels
Examples
--------
>>> print ggplot(mtcars, aes('mpg', 'q... | 25.514286 | 66 | 0.537514 | from .scale import scale
from copy import deepcopy
class scale_y_discrete(scale):
VALID_SCALES = ['name', 'limits', 'labels', 'breaks', 'trans']
def __radd__(self, gg):
gg = deepcopy(gg)
if self.name:
gg.ylab = self.name
if not (self.limits is None):
gg.ylimits =... | true | true |
1c04e23110f8adf2d367fa666187979ece7f0982 | 4,308 | py | Python | volatility3/framework/plugins/yarascan.py | leohearts/volatility3 | f52bd8d74fc47e63ea2611d0171b63dc589d4fdf | [
"Linux-OpenIB"
] | null | null | null | volatility3/framework/plugins/yarascan.py | leohearts/volatility3 | f52bd8d74fc47e63ea2611d0171b63dc589d4fdf | [
"Linux-OpenIB"
] | null | null | null | volatility3/framework/plugins/yarascan.py | leohearts/volatility3 | f52bd8d74fc47e63ea2611d0171b63dc589d4fdf | [
"Linux-OpenIB"
] | null | null | null | # This file is Copyright 2019 Volatility Foundation and licensed under the Volatility Software License 1.0
# which is available at https://www.volatilityfoundation.org/license/vsl-v1.0
#
import logging
from typing import Iterable, Tuple, List, Dict, Any
from volatility3.framework import interfaces, renderers
from vol... | 45.347368 | 119 | 0.570334 |
import logging
from typing import Iterable, Tuple, List, Dict, Any
from volatility3.framework import interfaces, renderers
from volatility3.framework.configuration import requirements
from volatility3.framework.interfaces import plugins
from volatility3.framework.layers import resources
from volatility3.framework.ren... | true | true |
1c04e23319e57690390600239043ece95adfd36e | 4,448 | py | Python | opensnoop.py | mcaleavya/bcc- | ec4f6778ac6492008328ad6dc328f1862521950a | [
"Apache-2.0"
] | 2 | 2016-12-09T02:44:07.000Z | 2018-11-25T06:41:48.000Z | opensnoop.py | mcaleavya/bcc-scripts | ec4f6778ac6492008328ad6dc328f1862521950a | [
"Apache-2.0"
] | null | null | null | opensnoop.py | mcaleavya/bcc-scripts | ec4f6778ac6492008328ad6dc328f1862521950a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# @lint-avoid-python-3-compatibility-imports
#
# opensnoop Trace open() syscalls.
# For Linux, uses BCC, eBPF. Embedded C.
#
# USAGE: statsnoop [-h] [-t] [-x] [-p PID]
#
# Copyright 2016 Netflix, Inc.
# Licensed under the Apache License, Version 2.0 (the "License")
#
# 08-Feb-2016 Brendan ... | 24.173913 | 73 | 0.622752 |
from __future__ import print_function
from bcc import BPF
import argparse
import ctypes as ct
examples = """examples:
./statsnoop # trace all stat() syscalls
./statsnoop -t # include timestamps
./statsnoop -x # only show failed stats
./statsnoop -p 181 # only trace PID 181
"... | true | true |
1c04e272e2cad32ccf0aaabba47ce2e61da69124 | 846 | py | Python | stft_core/utils/imports.py | lingyunwu14/STFT | 1af5d26c1d27388ef8b143b1de5713d5da8eb787 | [
"BSD-2-Clause"
] | 22 | 2021-07-09T12:42:33.000Z | 2022-03-31T08:36:39.000Z | stft_core/utils/imports.py | lingyunwu14/STFT | 1af5d26c1d27388ef8b143b1de5713d5da8eb787 | [
"BSD-2-Clause"
] | 1 | 2021-10-05T06:19:13.000Z | 2021-11-12T09:12:48.000Z | stft_core/utils/imports.py | lingyunwu14/STFT | 1af5d26c1d27388ef8b143b1de5713d5da8eb787 | [
"BSD-2-Clause"
] | 3 | 2021-07-09T12:42:55.000Z | 2022-03-31T08:36:40.000Z | # Copyright (c) SenseTime Research and its affiliates. All Rights Reserved.
import torch
if torch._six.PY3:
import importlib
import importlib.util
import sys
# from https://stackoverflow.com/questions/67631/how-to-import-a-module-given-the-full-path?utm_medium=organic&utm_source=google_rich_qa&utm_cam... | 36.782609 | 168 | 0.735225 | import torch
if torch._six.PY3:
import importlib
import importlib.util
import sys
def import_file(module_name, file_path, make_importable=False):
spec = importlib.util.spec_from_file_location(module_name, file_path)
module = importlib.util.module_from_spec(spec)
spec.loader... | true | true |
1c04e2869fe700f836d961c3a5ec02d89e0bb6f4 | 10,952 | py | Python | tests/unit/utils.py | allisonwang-db/dbt-databricks | 2c63ac8417667aff9ef299632f8212316fec1d05 | [
"Apache-2.0"
] | 38 | 2021-12-06T19:04:57.000Z | 2022-03-28T08:08:14.000Z | tests/unit/utils.py | allisonwang-db/dbt-databricks | 2c63ac8417667aff9ef299632f8212316fec1d05 | [
"Apache-2.0"
] | 36 | 2021-12-07T01:10:50.000Z | 2022-03-31T00:37:25.000Z | tests/unit/utils.py | allisonwang-db/dbt-databricks | 2c63ac8417667aff9ef299632f8212316fec1d05 | [
"Apache-2.0"
] | 11 | 2021-12-06T18:11:33.000Z | 2022-03-22T10:36:15.000Z | """Unit test utility functions.
Note that all imports should be inside the functions to avoid import/mocking
issues.
"""
import string
import os
from unittest import mock
from unittest import TestCase
import agate
import pytest
from dbt.dataclass_schema import ValidationError
from dbt.config.project import PartialProj... | 28.821053 | 95 | 0.657414 | import string
import os
from unittest import mock
from unittest import TestCase
import agate
import pytest
from dbt.dataclass_schema import ValidationError
from dbt.config.project import PartialProject
def normalize(path):
return os.path.normcase(os.path.normpath(path))
class Obj:
which = "blah"
single... | true | true |
1c04e2e5e80b06d186498de5a7428b550ab67c51 | 762 | py | Python | django/conf/locale/sq/formats.py | webjunkie/django | 5dbca13f3baa2e1bafd77e84a80ad6d8a074712e | [
"BSD-3-Clause"
] | 285 | 2019-12-23T09:50:21.000Z | 2021-12-08T09:08:49.000Z | django/conf/locale/sq/formats.py | webjunkie/django | 5dbca13f3baa2e1bafd77e84a80ad6d8a074712e | [
"BSD-3-Clause"
] | 18 | 2015-01-14T07:51:48.000Z | 2021-10-14T01:19:26.000Z | django/conf/locale/sq/formats.py | webjunkie/django | 5dbca13f3baa2e1bafd77e84a80ad6d8a074712e | [
"BSD-3-Clause"
] | 70 | 2015-01-01T00:33:24.000Z | 2021-12-10T03:43:07.000Z | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'd F Y'
TIME_FORMAT = 'g.i.s.A'
# ... | 30.48 | 77 | 0.751969 | from __future__ import unicode_literals
DATE_FORMAT = 'd F Y'
TIME_FORMAT = 'g.i.s.A'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT = 'j F'
SHORT_DATE_FORMAT = 'Y-m-d'
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '.'
| true | true |
1c04e4255af21a5452a8b9463f6b31912f701dea | 4,555 | py | Python | tests/predictors/predictor_test.py | jayjfu/allennlp | a3732d00a3e7dae3bff54bff19ece7b8b6eaca88 | [
"Apache-2.0"
] | 8 | 2021-08-09T14:12:09.000Z | 2022-03-15T09:56:44.000Z | tests/predictors/predictor_test.py | jayjfu/allennlp | a3732d00a3e7dae3bff54bff19ece7b8b6eaca88 | [
"Apache-2.0"
] | 71 | 2020-10-19T13:06:15.000Z | 2022-03-29T13:04:06.000Z | tests/predictors/predictor_test.py | jayjfu/allennlp | a3732d00a3e7dae3bff54bff19ece7b8b6eaca88 | [
"Apache-2.0"
] | 5 | 2018-07-02T01:20:31.000Z | 2021-07-15T11:32:50.000Z | from allennlp.common.testing import AllenNlpTestCase
from allennlp.models.archival import load_archive
from allennlp.predictors import Predictor
from allennlp.nn import util
class TestPredictor(AllenNlpTestCase):
def test_from_archive_does_not_consume_params(self):
archive = load_archive(
self... | 39.95614 | 108 | 0.669155 | from allennlp.common.testing import AllenNlpTestCase
from allennlp.models.archival import load_archive
from allennlp.predictors import Predictor
from allennlp.nn import util
class TestPredictor(AllenNlpTestCase):
def test_from_archive_does_not_consume_params(self):
archive = load_archive(
self... | true | true |
1c04e44e7aa1decaf1542b206fa20cb5c64fa1b3 | 2,704 | py | Python | src/OTLMOW/PostenMapping/StandaardPostFactory.py | davidvlaminck/OTLClassPython | 71330afeb37c3ea6d9981f521ff8f4a3f8b946fc | [
"MIT"
] | 2 | 2022-02-01T08:58:11.000Z | 2022-02-08T13:35:17.000Z | src/OTLMOW/PostenMapping/StandaardPostFactory.py | davidvlaminck/OTLMOW | 71330afeb37c3ea6d9981f521ff8f4a3f8b946fc | [
"MIT"
] | null | null | null | src/OTLMOW/PostenMapping/StandaardPostFactory.py | davidvlaminck/OTLMOW | 71330afeb37c3ea6d9981f521ff8f4a3f8b946fc | [
"MIT"
] | null | null | null | from OTLMOW.Facility.AssetFactory import AssetFactory
from OTLMOW.Facility.DotnotatieHelper import DotnotatieHelper
from OTLMOW.OTLModel.BaseClasses.OTLAsset import OTLAsset
from OTLMOW.PostenMapping.PostenLijst import PostenLijst
from OTLMOW.PostenMapping.StandaardPost import StandaardPost
class StandaardPostFactor... | 47.438596 | 181 | 0.720784 | from OTLMOW.Facility.AssetFactory import AssetFactory
from OTLMOW.Facility.DotnotatieHelper import DotnotatieHelper
from OTLMOW.OTLModel.BaseClasses.OTLAsset import OTLAsset
from OTLMOW.PostenMapping.PostenLijst import PostenLijst
from OTLMOW.PostenMapping.StandaardPost import StandaardPost
class StandaardPostFactor... | false | true |
1c04e487d21073f4d8685cd84ca9e74ea25f483d | 1,055 | py | Python | neurodsp/tests/sim/test_aperiodic.py | elybrand/neurodsp | 96355f4c75e1eedef2a77a8bfafc718f80b8dae3 | [
"Apache-2.0"
] | null | null | null | neurodsp/tests/sim/test_aperiodic.py | elybrand/neurodsp | 96355f4c75e1eedef2a77a8bfafc718f80b8dae3 | [
"Apache-2.0"
] | null | null | null | neurodsp/tests/sim/test_aperiodic.py | elybrand/neurodsp | 96355f4c75e1eedef2a77a8bfafc718f80b8dae3 | [
"Apache-2.0"
] | null | null | null | """Test aperiodic simulation functions."""
from neurodsp.tests.settings import FS, N_SECONDS
from neurodsp.tests.tutils import check_sim_output
from neurodsp.sim.aperiodic import *
from neurodsp.sim.aperiodic import _create_powerlaw
####################################################################################... | 26.375 | 99 | 0.606635 |
from neurodsp.tests.settings import FS, N_SECONDS
from neurodsp.tests.tutils import check_sim_output
from neurodsp.sim.aperiodic import *
from neurodsp.sim.aperiodic import _create_powerlaw
def test_sim_poisson_pop():
sig = sim_poisson_pop(N_SECONDS, FS)
check_sim_output(sig)
def test_sim_synaptic_current... | true | true |
1c04e51a746576ab60979f028c621f1423cc5c40 | 4,927 | py | Python | train.py | marblet/gat-pytorch | ff9cfad34460ab505458477ac43cd5f03fc78a46 | [
"MIT"
] | 17 | 2020-07-03T13:05:10.000Z | 2022-03-11T16:57:04.000Z | train.py | hbkt/gat-pytorch | ff9cfad34460ab505458477ac43cd5f03fc78a46 | [
"MIT"
] | 1 | 2021-05-10T02:59:24.000Z | 2022-01-04T03:07:25.000Z | train.py | hbkt/gat-pytorch | ff9cfad34460ab505458477ac43cd5f03fc78a46 | [
"MIT"
] | null | null | null | import torch
import torch.nn.functional as F
from torch.optim import Adam
from copy import deepcopy
from numpy import mean, std
from tqdm import tqdm
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
class EarlyStopping:
def __init__(self, patience, verbose, use_loss, use_acc, save_model):
... | 33.97931 | 101 | 0.567079 | import torch
import torch.nn.functional as F
from torch.optim import Adam
from copy import deepcopy
from numpy import mean, std
from tqdm import tqdm
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
class EarlyStopping:
def __init__(self, patience, verbose, use_loss, use_acc, save_model):
... | true | true |
1c04e51b17f453d6f41116a6deaac7011818ef42 | 3,605 | py | Python | kitsune/search/search_utils.py | mythmon/kitsune | 5eb9da88ad901f9474c4ea58a894bfc58f8637d6 | [
"BSD-3-Clause"
] | null | null | null | kitsune/search/search_utils.py | mythmon/kitsune | 5eb9da88ad901f9474c4ea58a894bfc58f8637d6 | [
"BSD-3-Clause"
] | 1 | 2021-04-30T20:33:35.000Z | 2021-04-30T20:33:35.000Z | kitsune/search/search_utils.py | feer56/Kitsune2 | 68daba37eae4eceaffcb1ca978c783955b42d2eb | [
"BSD-3-Clause"
] | 3 | 2020-06-14T06:59:46.000Z | 2020-06-15T14:45:56.000Z | from itertools import chain
from django.conf import settings
from kitsune import search as constants
from kitsune.questions.models import QuestionMappingType
from kitsune.search import es_utils
from kitsune.wiki.models import DocumentMappingType
def apply_boosts(searcher):
"""Returns searcher with boosts applie... | 30.811966 | 85 | 0.644383 | from itertools import chain
from django.conf import settings
from kitsune import search as constants
from kitsune.questions.models import QuestionMappingType
from kitsune.search import es_utils
from kitsune.wiki.models import DocumentMappingType
def apply_boosts(searcher):
return searcher.boost(
questio... | true | true |
1c04e56919bd57a4bdf35920fd4d1533f5474513 | 11,439 | py | Python | neutron/tests/fullstack/test_trunk.py | brandonlogan/neutron | 57364544aa8b0e7cd9d73550f287bcad574ba08c | [
"Apache-2.0"
] | 1 | 2017-09-10T09:57:35.000Z | 2017-09-10T09:57:35.000Z | neutron/tests/fullstack/test_trunk.py | brandonlogan/neutron | 57364544aa8b0e7cd9d73550f287bcad574ba08c | [
"Apache-2.0"
] | null | null | null | neutron/tests/fullstack/test_trunk.py | brandonlogan/neutron | 57364544aa8b0e7cd9d73550f287bcad574ba08c | [
"Apache-2.0"
] | 1 | 2015-05-05T14:41:11.000Z | 2015-05-05T14:41:11.000Z | # Copyright 2016 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | 37.504918 | 79 | 0.644812 |
import functools
import eventlet
import netaddr
from neutron_lib import constants
from oslo_utils import uuidutils
from neutron.common import utils
from neutron.services.trunk.drivers.openvswitch.agent import ovsdb_handler
from neutron.services.trunk.drivers.openvswitch.agent import trunk_manager
from neutron.servic... | true | true |
1c04e6349c615565dca362417fd41d352cbb3a02 | 2,253 | py | Python | dags/demo-dag.py | otaviomguerra/airflow-presentation | c83f37f9abe6cdf8c42d8050d393e18f80c91fee | [
"Apache-2.0"
] | null | null | null | dags/demo-dag.py | otaviomguerra/airflow-presentation | c83f37f9abe6cdf8c42d8050d393e18f80c91fee | [
"Apache-2.0"
] | null | null | null | dags/demo-dag.py | otaviomguerra/airflow-presentation | c83f37f9abe6cdf8c42d8050d393e18f80c91fee | [
"Apache-2.0"
] | null | null | null | from airflow import DAG
from airflow.providers.http.sensors.http import HttpSensor
from datetime import datetime, timedelta
from airflow.operators.python import PythonOperator
from airflow.providers.telegram.operators.telegram import TelegramOperator
import requests
import pandas as pd
from sqlalchemy import... | 30.04 | 106 | 0.650244 | from airflow import DAG
from airflow.providers.http.sensors.http import HttpSensor
from datetime import datetime, timedelta
from airflow.operators.python import PythonOperator
from airflow.providers.telegram.operators.telegram import TelegramOperator
import requests
import pandas as pd
from sqlalchemy import... | true | true |
1c04e725ae495971e73b61a9f192c645201476d7 | 5,098 | py | Python | app_config.py | nprapps/radex | eedc0254dbdca6bc520840c2c83240bb61a31dda | [
"FSFAP"
] | null | null | null | app_config.py | nprapps/radex | eedc0254dbdca6bc520840c2c83240bb61a31dda | [
"FSFAP"
] | null | null | null | app_config.py | nprapps/radex | eedc0254dbdca6bc520840c2c83240bb61a31dda | [
"FSFAP"
] | 1 | 2021-02-18T11:25:00.000Z | 2021-02-18T11:25:00.000Z | #!/usr/bin/env python
"""
Project-wide application configuration.
DO NOT STORE SECRETS, PASSWORDS, ETC. IN THIS FILE.
They will be exposed to users. Use environment variables instead.
See get_secrets() below for a fast way to access them.
"""
import os
"""
NAMES
"""
# Project name to be used in urls
# Use dashes, n... | 25.61809 | 132 | 0.682032 |
import os
PROJECT_SLUG = 'radex'
PROJECT_FILENAME = 'radex'
REPOSITORY_NAME = 'radex'
GITHUB_USERNAME = 'nprapps'
REPOSITORY_URL = 'git@github.com:%s/%s.git' % (GITHUB_USERNAME, REPOSITORY_NAME)
REPOSITORY_ALT_URL = None
# Project name used for assets rig
# Should stay the same, even if PROJECT_SLUG changes
ASSET... | true | true |
1c04e7673037e85ffaa0b48034214f4eca28b77b | 2,336 | py | Python | Python-Programs/Tkinter/API/API.py | adityaverma121/Simple-Programs | 8450560b97f89e0fa3da16a623ad35c0b26409c9 | [
"MIT"
] | 71 | 2021-09-30T11:25:12.000Z | 2021-10-03T11:33:22.000Z | Python-Programs/Tkinter/API/API.py | adityaverma121/Simple-Programs | 8450560b97f89e0fa3da16a623ad35c0b26409c9 | [
"MIT"
] | 186 | 2021-09-30T12:25:16.000Z | 2021-10-03T13:45:04.000Z | Python-Programs/Tkinter/API/API.py | adityaverma121/Simple-Programs | 8450560b97f89e0fa3da16a623ad35c0b26409c9 | [
"MIT"
] | 385 | 2021-09-30T11:34:23.000Z | 2021-10-03T13:41:00.000Z | import json
from io import BytesIO
from tkinter import *
from tkinter import messagebox
import requests
from PIL import Image, ImageTk
root = Tk()
# root.iconbitmap("D:\\Projects\\Python\\Tkinter\\api\\github.ico")
root.title("Github User Fetcher")
root.resizable(0, 0)
API = "https://api.github.com/users/"
def get_... | 29.56962 | 86 | 0.630565 | import json
from io import BytesIO
from tkinter import *
from tkinter import messagebox
import requests
from PIL import Image, ImageTk
root = Tk()
root.title("Github User Fetcher")
root.resizable(0, 0)
API = "https://api.github.com/users/"
def get_data(name):
global data
try:
api_request = requests.... | true | true |
1c04e80d98b145b358494655e7ea1048ebb84140 | 124 | py | Python | npweb/context_processors.py | ninepints/npweb | ff196586fa106757d7932b817cb830893a308d85 | [
"MIT"
] | null | null | null | npweb/context_processors.py | ninepints/npweb | ff196586fa106757d7932b817cb830893a308d85 | [
"MIT"
] | 1 | 2017-10-23T19:01:54.000Z | 2017-10-24T10:21:41.000Z | npweb/context_processors.py | ninepints/npweb | ff196586fa106757d7932b817cb830893a308d85 | [
"MIT"
] | 1 | 2017-10-23T11:28:33.000Z | 2017-10-23T11:28:33.000Z | from django.conf import settings
def analytics(request):
return {'google_analytics_id': settings.GOOGLE_ANALYTICS_ID}
| 20.666667 | 64 | 0.798387 | from django.conf import settings
def analytics(request):
return {'google_analytics_id': settings.GOOGLE_ANALYTICS_ID}
| true | true |
1c04e84e09bcc4d4de312495e8eab69715a50baa | 6,569 | py | Python | utils_spectral_norm.py | konstantinos-p/PAC_Bayesian_Generalization | c3ab6cdcfda4dcbdb9c5fb073f29490cde511b13 | [
"MIT"
] | 2 | 2020-05-10T14:39:45.000Z | 2020-05-10T18:49:22.000Z | utils_spectral_norm.py | konstantinos-p/PAC_Bayesian_Generalization | c3ab6cdcfda4dcbdb9c5fb073f29490cde511b13 | [
"MIT"
] | null | null | null | utils_spectral_norm.py | konstantinos-p/PAC_Bayesian_Generalization | c3ab6cdcfda4dcbdb9c5fb073f29490cde511b13 | [
"MIT"
] | null | null | null | """
In this script we have functions that calculate the spectral norm for different keras layers.
Specifically we can calculate the spectral norm of
1) convolutional
2) locally connected layers
. This is a difficult problem as the full operators are huge sparse matrices.
"""
import numpy as np
from keras.callbacks imp... | 35.701087 | 162 | 0.681991 |
import numpy as np
from keras.callbacks import Callback
def compute_spectral_norm_of_conv(weights,featuremap_dim):
dim1 = weights.shape[0]
dim2 = weights.shape[1]
dim3 = weights.shape[2]
dim4 = weights.shape[3]
fourier_weights = np.empty((featuremap_dim*featuremap_dim,dim3,dim4),dtyp... | true | true |
1c04e85cfc7be5c515cccdf5539fca6a03e294c8 | 2,664 | py | Python | py/desitarget/test/test_subpriority.py | echaussidon/desitarget | 1206380dac5155b9e7bf238c7cb187bc797d78a3 | [
"BSD-3-Clause"
] | 13 | 2016-02-02T00:26:21.000Z | 2022-01-14T07:31:59.000Z | py/desitarget/test/test_subpriority.py | echaussidon/desitarget | 1206380dac5155b9e7bf238c7cb187bc797d78a3 | [
"BSD-3-Clause"
] | 674 | 2015-09-15T15:02:06.000Z | 2022-02-23T18:39:02.000Z | py/desitarget/test/test_subpriority.py | echaussidon/desitarget | 1206380dac5155b9e7bf238c7cb187bc797d78a3 | [
"BSD-3-Clause"
] | 29 | 2015-06-09T13:51:48.000Z | 2021-06-05T06:03:18.000Z | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
"""Test desitarget.subpriority
"""
import unittest
from pkg_resources import resource_filename
import numpy as np
import os
from astropy.table import Table
import desitarget.subpriority
class TestSubpriority(unittest.TestCase):
... | 33.3 | 87 | 0.621997 | import unittest
from pkg_resources import resource_filename
import numpy as np
import os
from astropy.table import Table
import desitarget.subpriority
class TestSubpriority(unittest.TestCase):
@classmethod
def setUp(self):
pass
def test_override(self):
n = 10
targets = Table()
... | true | true |
1c04e8d5f645a7312189822d7eaf4ab505984db7 | 6,231 | py | Python | graphkit/base.py | IamVNIE/graphkit | 6c83c5b16b698ef29773dfd63167ec70350d3c25 | [
"Apache-2.0"
] | 65 | 2016-07-09T21:52:47.000Z | 2022-03-04T03:08:03.000Z | graphkit/base.py | IamVNIE/graphkit | 6c83c5b16b698ef29773dfd63167ec70350d3c25 | [
"Apache-2.0"
] | 33 | 2016-07-21T22:20:53.000Z | 2021-06-19T17:19:42.000Z | graphkit/base.py | huyng/graphkit | e70718bbc7b394280c39c1fda381bcebd4c3de8d | [
"Apache-2.0"
] | 20 | 2016-07-14T23:34:49.000Z | 2022-03-04T03:08:09.000Z | # Copyright 2016, Yahoo Inc.
# Licensed under the terms of the Apache License, Version 2.0. See the LICENSE file associated with the project for terms.
class Data(object):
"""
This wraps any data that is consumed or produced
by a Operation. This data should also know how to serialize
itself appropriate... | 34.425414 | 122 | 0.615632 |
class Data(object):
def __init__(self, **kwargs):
pass
def get_data(self):
raise NotImplementedError
def set_data(self, data):
raise NotImplementedError
class Operation(object):
def __init__(self, **kwargs):
self.name = kwargs.get('name')
self.needs ... | true | true |
1c04e91168b1288aa85b202822ec6c33058803c0 | 2,619 | py | Python | courses/machine_learning/deepdive2/structured/solutions/application/main.py | memeyankm/training-data-analyst | 33bdca94cb063036f7313a2eaf6e515126d31344 | [
"Apache-2.0"
] | 6,140 | 2016-05-23T16:09:35.000Z | 2022-03-30T19:00:46.000Z | courses/machine_learning/deepdive2/structured/solutions/application/main.py | memeyankm/training-data-analyst | 33bdca94cb063036f7313a2eaf6e515126d31344 | [
"Apache-2.0"
] | 1,384 | 2016-07-08T22:26:41.000Z | 2022-03-24T16:39:43.000Z | courses/machine_learning/deepdive2/structured/solutions/application/main.py | memeyankm/training-data-analyst | 33bdca94cb063036f7313a2eaf6e515126d31344 | [
"Apache-2.0"
] | 5,110 | 2016-05-27T13:45:18.000Z | 2022-03-31T18:40:42.000Z | import os
from flask import Flask
from flask import render_template
from flask import request
from googleapiclient import discovery
from oauth2client.client import GoogleCredentials
credentials = GoogleCredentials.get_application_default()
api = discovery.build("ml", "v1", credentials=credentials)
app = Flask(__nam... | 34.92 | 96 | 0.661321 | import os
from flask import Flask
from flask import render_template
from flask import request
from googleapiclient import discovery
from oauth2client.client import GoogleCredentials
credentials = GoogleCredentials.get_application_default()
api = discovery.build("ml", "v1", credentials=credentials)
app = Flask(__nam... | true | true |
1c04ea7587a76f713360216833122f6b75d9d9da | 14,173 | py | Python | chemprop/features/featurization.py | SoftServeInc/yield-paper | cbf9710e6866841e231e3f851786a4d7dc4a5c72 | [
"MIT"
] | 2 | 2021-09-02T17:40:14.000Z | 2021-11-30T09:49:43.000Z | chemprop/features/featurization.py | SoftServeInc/yield-paper | cbf9710e6866841e231e3f851786a4d7dc4a5c72 | [
"MIT"
] | null | null | null | chemprop/features/featurization.py | SoftServeInc/yield-paper | cbf9710e6866841e231e3f851786a4d7dc4a5c72 | [
"MIT"
] | 1 | 2021-12-01T18:04:17.000Z | 2021-12-01T18:04:17.000Z | from argparse import Namespace
from typing import List, Tuple, Union
from rdkit import Chem
import torch
from chemprop.mol_utils import str_to_mol
# Atom feature sizes
MAX_ATOMIC_NUM = 100
ATOM_FEATURES = {
'atomic_num': list(range(MAX_ATOMIC_NUM)),
'degree': [0, 1, 2, 3, 4, 5],
'formal_charge': [-1, -2,... | 40.264205 | 146 | 0.63113 | from argparse import Namespace
from typing import List, Tuple, Union
from rdkit import Chem
import torch
from chemprop.mol_utils import str_to_mol
MAX_ATOMIC_NUM = 100
ATOM_FEATURES = {
'atomic_num': list(range(MAX_ATOMIC_NUM)),
'degree': [0, 1, 2, 3, 4, 5],
'formal_charge': [-1, -2, 1, 2, 0],
'chira... | true | true |
1c04ece405be94e690ca9ee0f7e03cf3481a07c0 | 8,119 | py | Python | bin/modules/FastqFile.py | pegasus-isi/pegasus-gtfar | bc1d364b5b84fc59f7764417903ab1f08501d906 | [
"Apache-2.0"
] | null | null | null | bin/modules/FastqFile.py | pegasus-isi/pegasus-gtfar | bc1d364b5b84fc59f7764417903ab1f08501d906 | [
"Apache-2.0"
] | null | null | null | bin/modules/FastqFile.py | pegasus-isi/pegasus-gtfar | bc1d364b5b84fc59f7764417903ab1f08501d906 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import os
import sys
import difflib
from collections import defaultdict as dd
sys.path.append('/home/rcf-47/souaiaia/analysis/tade/gtfar_source/modules')
##########################################################################################################################################
#... | 39.79902 | 188 | 0.560907 |
import os
import sys
import difflib
from collections import defaultdict as dd
sys.path.append('/home/rcf-47/souaiaia/analysis/tade/gtfar_source/modules')
class FastqFile:
def __init__(self,fileHandle,rlen,lowQ,avgQ,minTrim,multiple):
self.fname = fileHandle
self.readLen ,self.lowQual, s... | false | true |
1c04ed421dc65cb208becb3081b5c89178d22fc8 | 2,837 | py | Python | pyfr/integrators/dual/pseudo/__init__.py | tktsai/PyFR | d29d5b5c4d0ca477b87be2292183be333ad1e380 | [
"BSD-3-Clause"
] | 1 | 2020-09-27T23:47:46.000Z | 2020-09-27T23:47:46.000Z | pyfr/integrators/dual/pseudo/__init__.py | tktsai/PyFR | d29d5b5c4d0ca477b87be2292183be333ad1e380 | [
"BSD-3-Clause"
] | null | null | null | pyfr/integrators/dual/pseudo/__init__.py | tktsai/PyFR | d29d5b5c4d0ca477b87be2292183be333ad1e380 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from pkg_resources import resource_listdir
import re
from pyfr.integrators.dual.pseudo.pseudocontrollers import BaseDualPseudoController
from pyfr.integrators.dual.pseudo.pseudosteppers import BaseDualPseudoStepper, DualDenseRKPseudoStepper
from pyfr.integrators.dual.pseudo.multip import DualM... | 38.863014 | 103 | 0.642228 |
from pkg_resources import resource_listdir
import re
from pyfr.integrators.dual.pseudo.pseudocontrollers import BaseDualPseudoController
from pyfr.integrators.dual.pseudo.pseudosteppers import BaseDualPseudoStepper, DualDenseRKPseudoStepper
from pyfr.integrators.dual.pseudo.multip import DualMultiPIntegrator
from pyf... | true | true |
1c04ed43d2dcbee9cde2ff5d2e013d55f6150701 | 1,220 | py | Python | v1.0.0.test/toontown/classicchars/DistributedWitchMinnie.py | TTOFFLINE-LEAK/ttoffline | bb0e91704a755d34983e94288d50288e46b68380 | [
"MIT"
] | 4 | 2019-07-01T15:46:43.000Z | 2021-07-23T16:26:48.000Z | v1.0.0.test/toontown/classicchars/DistributedWitchMinnie.py | TTOFFLINE-LEAK/ttoffline | bb0e91704a755d34983e94288d50288e46b68380 | [
"MIT"
] | 1 | 2019-06-29T03:40:05.000Z | 2021-06-13T01:15:16.000Z | v1.0.0.test/toontown/classicchars/DistributedWitchMinnie.py | TTOFFLINE-LEAK/ttoffline | bb0e91704a755d34983e94288d50288e46b68380 | [
"MIT"
] | 4 | 2019-07-28T21:18:46.000Z | 2021-02-25T06:37:25.000Z | from panda3d.core import *
import DistributedCCharBase
from direct.directnotify import DirectNotifyGlobal
from direct.fsm import ClassicFSM, State
from direct.fsm import State
from toontown.classicchars import DistributedMinnie
import CharStateDatas
from toontown.toonbase import ToontownGlobals
from toontown.toonbase i... | 46.923077 | 274 | 0.754918 | from panda3d.core import *
import DistributedCCharBase
from direct.directnotify import DirectNotifyGlobal
from direct.fsm import ClassicFSM, State
from direct.fsm import State
from toontown.classicchars import DistributedMinnie
import CharStateDatas
from toontown.toonbase import ToontownGlobals
from toontown.toonbase i... | true | true |
1c04ee3b004d6da1b188ae2cb46b9e5e5b5fae58 | 1,942 | py | Python | ote_sdk/ote_sdk/tests/configuration/enums/test_model_lifecycle.py | vyashina/training_extensions | e7aa33af94a1f8004d3ea2df259d99234dfca046 | [
"Apache-2.0"
] | null | null | null | ote_sdk/ote_sdk/tests/configuration/enums/test_model_lifecycle.py | vyashina/training_extensions | e7aa33af94a1f8004d3ea2df259d99234dfca046 | [
"Apache-2.0"
] | null | null | null | ote_sdk/ote_sdk/tests/configuration/enums/test_model_lifecycle.py | vyashina/training_extensions | e7aa33af94a1f8004d3ea2df259d99234dfca046 | [
"Apache-2.0"
] | null | null | null | # INTEL CONFIDENTIAL
#
# Copyright (C) 2021 Intel Corporation
#
# This software and the related documents are Intel copyrighted materials, and
# your use of them is governed by the express license under which they were provided to
# you ("License"). Unless the License provides otherwise, you may not use, modify, copy,
... | 41.319149 | 113 | 0.738414 | #
# This software and the related documents are provided as is,
# with no express or implied warranties, other than those that are expressly stated
# in the License.
import pytest
from ote_sdk.configuration.enums.model_lifecycle import ModelLifecycle
from ote_sdk.tests.constants.ote_sdk_components import OteSdkCompon... | true | true |
1c04f022fadd50ee2c2c54241c7cf405d8aab6e0 | 399 | py | Python | djangogirls/djangogirls/wsgi.py | codrelphi/djangoApps | 1c20a6a41dbec3a964b5058626e081fdc53957bd | [
"MIT"
] | 1 | 2019-10-12T13:13:38.000Z | 2019-10-12T13:13:38.000Z | djangogirls/wsgi.py | cabicho/djangogirls | 5915e508a52d1ad6e64e887dc51d3192947ac793 | [
"MIT"
] | 6 | 2020-06-05T23:36:52.000Z | 2021-06-10T18:54:37.000Z | djangogirls/wsgi.py | cabicho/djangogirls | 5915e508a52d1ad6e64e887dc51d3192947ac793 | [
"MIT"
] | 3 | 2019-09-25T17:28:46.000Z | 2020-06-17T21:58:21.000Z | """
WSGI config for djangogirls project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_S... | 23.470588 | 78 | 0.789474 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'djangogirls.settings')
application = get_wsgi_application()
| true | true |
1c04f098941c4b15dba6afbc8f93fc1fc515b560 | 359 | py | Python | Lesson1Number9_find_ciscoconfparse.py | blaforest/pynet | 0e9a274cddf21afd1820823173c5ae63b30f2c42 | [
"Apache-2.0"
] | null | null | null | Lesson1Number9_find_ciscoconfparse.py | blaforest/pynet | 0e9a274cddf21afd1820823173c5ae63b30f2c42 | [
"Apache-2.0"
] | null | null | null | Lesson1Number9_find_ciscoconfparse.py | blaforest/pynet | 0e9a274cddf21afd1820823173c5ae63b30f2c42 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#Lesson1Number9 trying a different way
from ciscoconfparse import CiscoConfParse
cisco_cfg = CiscoConfParse("cisco.txt")
print "\n\ncrypto map entries using PFS group2\n"
crypto_maps = cisco_cfg.find_objects_w_child(parentspec=r"^crypto map CRYPTO", childspec=r"set pfs group2")
for crypto_map ... | 27.615385 | 107 | 0.802228 |
from ciscoconfparse import CiscoConfParse
cisco_cfg = CiscoConfParse("cisco.txt")
print "\n\ncrypto map entries using PFS group2\n"
crypto_maps = cisco_cfg.find_objects_w_child(parentspec=r"^crypto map CRYPTO", childspec=r"set pfs group2")
for crypto_map in crypto_maps:
print crypto_map.text
| false | true |
1c04f0db3e202bbf1f1645db0ef2f892c7ca51f1 | 1,131 | py | Python | python/src/iceberg/avro/codecs/codec.py | felixYyu/iceberg | 120cbe9a5db4cedec76d2a7f097ec67de9c25c96 | [
"Apache-2.0"
] | 1 | 2021-11-18T02:27:29.000Z | 2021-11-18T02:27:29.000Z | python/src/iceberg/avro/codecs/codec.py | felixYyu/iceberg | 120cbe9a5db4cedec76d2a7f097ec67de9c25c96 | [
"Apache-2.0"
] | null | null | null | python/src/iceberg/avro/codecs/codec.py | felixYyu/iceberg | 120cbe9a5db4cedec76d2a7f097ec67de9c25c96 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 33.264706 | 62 | 0.735632 | from __future__ import annotations
from abc import ABC, abstractmethod
class Codec(ABC):
@staticmethod
@abstractmethod
def compress(data: bytes) -> tuple[bytes, int]:
...
@staticmethod
@abstractmethod
def decompress(data: bytes) -> bytes:
...
| true | true |
1c04f16b56eed1b2c99e5f3ba841afb18441aa34 | 39,535 | py | Python | venv/lib/python3.8/site-packages/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/models/_models.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | null | null | null | venv/lib/python3.8/site-packages/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/models/_models.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | null | null | null | venv/lib/python3.8/site-packages/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/models/_models.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | 2 | 2021-05-23T16:46:31.000Z | 2021-05-26T23:51:09.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 41.484785 | 120 | 0.667763 |
from msrest.serialization import Model
from msrest.exceptions import HttpOperationError
class AzureResourceBase(Model):
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str... | true | true |
1c04f18aa9e406576f04b8f109a268bedec7371d | 31,080 | py | Python | tests/test_20_assertion.py | skanct/pysaml2 | 0c1e26a6dd8759962857a30ebd67f63fe9e881ee | [
"Apache-2.0"
] | null | null | null | tests/test_20_assertion.py | skanct/pysaml2 | 0c1e26a6dd8759962857a30ebd67f63fe9e881ee | [
"Apache-2.0"
] | 1 | 2021-06-25T15:15:52.000Z | 2021-06-25T15:15:52.000Z | tests/test_20_assertion.py | skanct/pysaml2 | 0c1e26a6dd8759962857a30ebd67f63fe9e881ee | [
"Apache-2.0"
] | 2 | 2018-12-07T06:39:05.000Z | 2018-12-07T06:50:00.000Z | # coding=utf-8
import pytest
from saml2.argtree import add_path
from saml2.authn_context import pword
from saml2.mdie import to_dict
from saml2 import md, assertion
from saml2.saml import Attribute
from saml2.saml import Issuer
from saml2.saml import NAMEID_FORMAT_ENTITY
from saml2.saml import NAME_FORMAT_URI
from sam... | 32.78481 | 81 | 0.563771 | import pytest
from saml2.argtree import add_path
from saml2.authn_context import pword
from saml2.mdie import to_dict
from saml2 import md, assertion
from saml2.saml import Attribute
from saml2.saml import Issuer
from saml2.saml import NAMEID_FORMAT_ENTITY
from saml2.saml import NAME_FORMAT_URI
from saml2.saml import ... | true | true |
1c04f22b351b97cbe0e741f8724bb8f1356a7e04 | 6,433 | py | Python | tools/adaptive_detection_features_converter.py | aioz-ai/ECCVW20_MILQT | 5fa179cb880d8915af96e9f0cd8c742f75fdc8b7 | [
"MIT"
] | 3 | 2021-05-12T04:44:02.000Z | 2021-07-28T07:40:04.000Z | tools/adaptive_detection_features_converter.py | aioz-ai/ECCVW20_MILQT | 5fa179cb880d8915af96e9f0cd8c742f75fdc8b7 | [
"MIT"
] | null | null | null | tools/adaptive_detection_features_converter.py | aioz-ai/ECCVW20_MILQT | 5fa179cb880d8915af96e9f0cd8c742f75fdc8b7 | [
"MIT"
] | null | null | null | """
This code is modified from Hengyuan Hu's repository.
https://github.com/hengyuan-hu/bottom-up-attention-vqa
Reads in a tsv file with pre-trained bottom up attention features
of the adaptive number of boxes and stores it in HDF5 format.
Also store {image_id: feature_idx} as a pickle file.
Hierarchy of HDF5 file... | 35.938547 | 101 | 0.568164 | from __future__ import print_function
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import base64
import csv
import h5py
import _pickle as cPickle
import numpy as np
import utils
import os
csv.field_size_limit(sys.maxsize)
def extract(split, infiles, outfiles):
... | true | true |
1c04f27427a241d1ee1b1c7ea51a007df22d8ae0 | 2,812 | py | Python | cloudcafe/compute/extensions/rescue_api/client.py | rcbops-qa/cloudcafe | d937f85496aadafbb94a330b9adb8ea18bee79ba | [
"Apache-2.0"
] | null | null | null | cloudcafe/compute/extensions/rescue_api/client.py | rcbops-qa/cloudcafe | d937f85496aadafbb94a330b9adb8ea18bee79ba | [
"Apache-2.0"
] | null | null | null | cloudcafe/compute/extensions/rescue_api/client.py | rcbops-qa/cloudcafe | d937f85496aadafbb94a330b9adb8ea18bee79ba | [
"Apache-2.0"
] | 1 | 2020-04-13T17:44:28.000Z | 2020-04-13T17:44:28.000Z | """
Copyright 2013 Rackspace
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, software
dist... | 40.171429 | 73 | 0.692745 |
from cafe.engine.http.client import AutoMarshallingHTTPClient
from cloudcafe.compute.servers_api.models.servers import Server
from cloudcafe.compute.extensions.rescue_api.models.requests import \
RescueMode, ExitRescueMode
from cloudcafe.compute.extensions.rescue_api.models.responses import \
RescueResponse
... | true | true |
1c04f313e7bb008abb4d735d7b99735692168ff3 | 12,662 | py | Python | selfdrive/car/fw_versions.py | chengyu-k/openpilot | 72bbddadc2a468c4436594326b5819bad03c078d | [
"MIT"
] | 121 | 2019-03-27T06:34:51.000Z | 2021-06-15T14:37:29.000Z | selfdrive/car/fw_versions.py | chengyu-k/openpilot | 72bbddadc2a468c4436594326b5819bad03c078d | [
"MIT"
] | 54 | 2019-04-11T08:51:58.000Z | 2021-06-13T17:04:22.000Z | selfdrive/car/fw_versions.py | chengyu-k/openpilot | 72bbddadc2a468c4436594326b5819bad03c078d | [
"MIT"
] | 139 | 2019-07-16T07:25:05.000Z | 2021-06-09T11:27:53.000Z | #!/usr/bin/env python3
import struct
import traceback
from typing import Any
from collections import defaultdict
from tqdm import tqdm
import panda.python.uds as uds
from cereal import car
from selfdrive.car.fingerprints import FW_VERSIONS, get_attr_from_cars
from selfdrive.car.isotp_parallel_query import IsoTpParall... | 33.060052 | 153 | 0.719713 | import struct
import traceback
from typing import Any
from collections import defaultdict
from tqdm import tqdm
import panda.python.uds as uds
from cereal import car
from selfdrive.car.fingerprints import FW_VERSIONS, get_attr_from_cars
from selfdrive.car.isotp_parallel_query import IsoTpParallelQuery
from selfdrive.... | true | true |
1c04f3b7de317bb2c9fadc3dd925f8b68b1961e7 | 748 | py | Python | cvtest/csv_reporter.py | Gasol/opencv-log | 2b915cbef7efeba2cab4dd959ea55e8d638814d2 | [
"MIT"
] | null | null | null | cvtest/csv_reporter.py | Gasol/opencv-log | 2b915cbef7efeba2cab4dd959ea55e8d638814d2 | [
"MIT"
] | null | null | null | cvtest/csv_reporter.py | Gasol/opencv-log | 2b915cbef7efeba2cab4dd959ea55e8d638814d2 | [
"MIT"
] | null | null | null | import os
from shutil import rmtree
import csv
class CsvReporter:
def __init__(self, file_path):
self.__file_path = file_path
self.__fields = ["Test Image", "Result", "Message"]
self.__create_file()
def __create_file(self):
dir_path = os.path.dirname(self.__file_path)
i... | 27.703704 | 59 | 0.612299 | import os
from shutil import rmtree
import csv
class CsvReporter:
def __init__(self, file_path):
self.__file_path = file_path
self.__fields = ["Test Image", "Result", "Message"]
self.__create_file()
def __create_file(self):
dir_path = os.path.dirname(self.__file_path)
i... | true | true |
1c04f3f446d2c4ce5798623389d973f1e3f0aaef | 106 | py | Python | josma.py | Josmarith/hola_mundo | f70d7aaaf677bbb0f424a6f4ee8830d310a5bedb | [
"Apache-2.0"
] | null | null | null | josma.py | Josmarith/hola_mundo | f70d7aaaf677bbb0f424a6f4ee8830d310a5bedb | [
"Apache-2.0"
] | null | null | null | josma.py | Josmarith/hola_mundo | f70d7aaaf677bbb0f424a6f4ee8830d310a5bedb | [
"Apache-2.0"
] | null | null | null | name= input("¿Cómo te llamas? ")
n= input ("Introduce un número entero: ")
print((name + "\n") * int (n))
| 26.5 | 41 | 0.603774 | name= input("¿Cómo te llamas? ")
n= input ("Introduce un número entero: ")
print((name + "\n") * int (n))
| true | true |
1c04f4b666ffa6de10f31be63f863aae64090dea | 5,342 | py | Python | mmocr/datasets/icdar_dataset.py | johnsonkee/mmocr_wxz | 867b91664ea373873557743c2a4be23fa014b14f | [
"Apache-2.0"
] | null | null | null | mmocr/datasets/icdar_dataset.py | johnsonkee/mmocr_wxz | 867b91664ea373873557743c2a4be23fa014b14f | [
"Apache-2.0"
] | null | null | null | mmocr/datasets/icdar_dataset.py | johnsonkee/mmocr_wxz | 867b91664ea373873557743c2a4be23fa014b14f | [
"Apache-2.0"
] | null | null | null | import numpy as np
from pycocotools.coco import COCO
import mmocr.utils as utils
from mmdet.datasets.builder import DATASETS
from mmdet.datasets.coco import CocoDataset
from mmocr.core.evaluation.hmean import eval_hmean
import pdb
@DATASETS.register_module()
class IcdarDataset(CocoDataset):
CLASSES = ('text')
... | 33.180124 | 79 | 0.553725 | import numpy as np
from pycocotools.coco import COCO
import mmocr.utils as utils
from mmdet.datasets.builder import DATASETS
from mmdet.datasets.coco import CocoDataset
from mmocr.core.evaluation.hmean import eval_hmean
import pdb
@DATASETS.register_module()
class IcdarDataset(CocoDataset):
CLASSES = ('text')
... | true | true |
1c04f5b55f7a92b3f95167caaba82aa971159f4f | 3,926 | py | Python | exploit/tpwnt.py | RussianOtter/Mobilesploit | 68e5b84b8b91efd3dd363dc9cce382a571acd77c | [
"BSD-3-Clause"
] | 26 | 2017-08-18T11:18:24.000Z | 2021-04-14T06:15:36.000Z | exploit/tpwnt.py | RussianOtter/Mobilesploit | 68e5b84b8b91efd3dd363dc9cce382a571acd77c | [
"BSD-3-Clause"
] | null | null | null | exploit/tpwnt.py | RussianOtter/Mobilesploit | 68e5b84b8b91efd3dd363dc9cce382a571acd77c | [
"BSD-3-Clause"
] | 6 | 2018-02-19T17:23:44.000Z | 2021-01-18T01:47:23.000Z | # Exploit Title: TpwnT - iOS Denail of Service POC
# Date: 10-31-2017
# Exploit Author: Russian Otter (Ro)
# Vendor Homepage: https://support.apple.com/en-us/HT208222
# Version: 2.1
# Tested on: iOS 10.3.2 - 11.1
# CVE: CVE-2017-13849
# Rank: regular
# Software: iOS
# Platform: iOS
"""
-------------------------
C... | 39.656566 | 1,025 | 0.753184 |
import argparse, socket
import sys
try:
if type(__mbsargs__) == list:
sys.argv = __mbsargs__
except:
pass
parse = argparse.ArgumentParser(description="iOS Denial of Service Vuln iOS<11.1 CoreText")
parse.add_argument("-H", "--host", help="Target iOS server (must display text on server-side)", type=str, required=... | true | true |
1c04f62082b9dd4c55ba9e02a6b32931e0b47db2 | 642 | py | Python | demo/app/admin.py | khm56/django-address-model | 7f184562bc5f28b9ceb2280ac2fac2c8c1cbf29b | [
"MIT"
] | 12 | 2019-08-12T03:34:05.000Z | 2022-01-02T00:23:28.000Z | demo/app/admin.py | khm56/django-address-model | 7f184562bc5f28b9ceb2280ac2fac2c8c1cbf29b | [
"MIT"
] | 3 | 2020-11-18T09:52:38.000Z | 2020-12-03T20:31:51.000Z | demo/app/admin.py | khm56/django-address-model | 7f184562bc5f28b9ceb2280ac2fac2c8c1cbf29b | [
"MIT"
] | 3 | 2020-06-16T16:49:00.000Z | 2021-07-15T04:41:44.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from app.models import Profile
@admin.register(Profile)
class ProfileAdmin(admin.ModelAdmin):
list_display = ('name', 'email', 'phone', 'full_address')
fie... | 32.1 | 82 | 0.700935 | from __future__ import unicode_literals
from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from app.models import Profile
@admin.register(Profile)
class ProfileAdmin(admin.ModelAdmin):
list_display = ('name', 'email', 'phone', 'full_address')
fields = ('name', 'email', ... | true | true |
1c04f64c19bec482cc4a1a19d8f885b0f208be8f | 780 | py | Python | pyscf/nao/m_siesta2blanko_denvec.py | KMCzajkowski/pyscf | e8af41d910cc0d3963655120c0b689590ad978e7 | [
"BSD-2-Clause"
] | null | null | null | pyscf/nao/m_siesta2blanko_denvec.py | KMCzajkowski/pyscf | e8af41d910cc0d3963655120c0b689590ad978e7 | [
"BSD-2-Clause"
] | null | null | null | pyscf/nao/m_siesta2blanko_denvec.py | KMCzajkowski/pyscf | e8af41d910cc0d3963655120c0b689590ad978e7 | [
"BSD-2-Clause"
] | null | null | null | import numpy as np
#
#
#
def _siesta2blanko_denvec(orb2m, vec, orb_sc2orb_uc=None):
n,nreim = vec.shape
if orb_sc2orb_uc is None:
orb_sc2m = orb2m
else:
orb_sc2m = np.zeros_like(orb_sc2orb_uc)
for orb_sc,orb_uc in enumerate(orb_sc2orb_uc): orb_sc2m[orb_sc] = orb2m[orb_uc]
orb2ph = (-1.0)**orb_sc... | 21.081081 | 89 | 0.611538 | import numpy as np
def _siesta2blanko_denvec(orb2m, vec, orb_sc2orb_uc=None):
n,nreim = vec.shape
if orb_sc2orb_uc is None:
orb_sc2m = orb2m
else:
orb_sc2m = np.zeros_like(orb_sc2orb_uc)
for orb_sc,orb_uc in enumerate(orb_sc2orb_uc): orb_sc2m[orb_sc] = orb2m[orb_uc]
orb2ph = (-1.0)**orb_sc2m
... | true | true |
1c04f7b044e2c1c56058746ed02206dc99ed3ff2 | 18,249 | py | Python | ding/entry/tests/test_serial_entry.py | sailxjx/DI-engine | c6763f8e2ba885a2a02f611195a1b5f8b50bff00 | [
"Apache-2.0"
] | null | null | null | ding/entry/tests/test_serial_entry.py | sailxjx/DI-engine | c6763f8e2ba885a2a02f611195a1b5f8b50bff00 | [
"Apache-2.0"
] | null | null | null | ding/entry/tests/test_serial_entry.py | sailxjx/DI-engine | c6763f8e2ba885a2a02f611195a1b5f8b50bff00 | [
"Apache-2.0"
] | null | null | null | import pytest
import time
import os
from copy import deepcopy
from ding.entry import serial_pipeline, collect_demo_data, serial_pipeline_offline
from dizoo.classic_control.cartpole.config.cartpole_dqn_config import cartpole_dqn_config, cartpole_dqn_create_config
from dizoo.classic_control.cartpole.config.cartpole_ppo_... | 38.910448 | 199 | 0.761795 | import pytest
import time
import os
from copy import deepcopy
from ding.entry import serial_pipeline, collect_demo_data, serial_pipeline_offline
from dizoo.classic_control.cartpole.config.cartpole_dqn_config import cartpole_dqn_config, cartpole_dqn_create_config
from dizoo.classic_control.cartpole.config.cartpole_ppo_... | true | true |
1c04f8d3b7c5d8f05e70bb52c61b1d10def7a2f0 | 2,390 | py | Python | wf.py | jia-alt/uuu | 7af2ccd7778d3d8fc8099648f33bfb976803f305 | [
"MIT"
] | null | null | null | wf.py | jia-alt/uuu | 7af2ccd7778d3d8fc8099648f33bfb976803f305 | [
"MIT"
] | null | null | null | wf.py | jia-alt/uuu | 7af2ccd7778d3d8fc8099648f33bfb976803f305 | [
"MIT"
] | null | null | null | import sys
import getopt
import re
import os
def count_split(str):
text= re.findall(r'[a-z0-9^-]+', str) #指定特殊字符
#字符替换
dict = {} #创建字典
for str in text: #遍历文件内单词
if str in dict.keys():
dict... | 33.194444 | 73 | 0.423013 | import sys
import getopt
import re
import os
def count_split(str):
text= re.findall(r'[a-z0-9^-]+', str) dict = {} for str in text: if str in dict.keys():
dict[str] = dict[str] + 1
el... | true | true |
1c04fa9c30163421d0e9c1e7f42f7a0ff2936fd0 | 1,925 | py | Python | playwell-python-service/playwell/service/config.py | jiyulongxu/playwell | 3a5dc4d009c6fd75487e208edf0318db4f9ad21d | [
"Apache-2.0"
] | 4 | 2019-09-01T02:05:09.000Z | 2022-01-04T06:08:14.000Z | playwell-python-service/playwell/service/config.py | jiyulongxu/playwell | 3a5dc4d009c6fd75487e208edf0318db4f9ad21d | [
"Apache-2.0"
] | null | null | null | playwell-python-service/playwell/service/config.py | jiyulongxu/playwell | 3a5dc4d009c6fd75487e208edf0318db4f9ad21d | [
"Apache-2.0"
] | 6 | 2019-11-14T13:55:17.000Z | 2022-02-09T01:42:24.000Z | """该模块会从配置文件中加载配置,并维护这些配置项
"""
import yaml
import pydoc
from playwell.service import PlaywellServiceException
class ConfigItems:
LOG = "log"
PLAYWELL_API = "playwell_api"
INPUT_MESSAGE_BUS = "input_message_bus"
WEB_SERVER = "web_server"
ALL_LOCAL_SERVICE = "local_service"
RUNNER = "runn... | 24.0625 | 81 | 0.733506 | import yaml
import pydoc
from playwell.service import PlaywellServiceException
class ConfigItems:
LOG = "log"
PLAYWELL_API = "playwell_api"
INPUT_MESSAGE_BUS = "input_message_bus"
WEB_SERVER = "web_server"
ALL_LOCAL_SERVICE = "local_service"
RUNNER = "runner"
CONFIG_HOOK = "config_... | true | true |
1c04fb200ebab140684c246b9ae3a9ca2b98ac5b | 2,698 | py | Python | test/geometry/epipolar/test_epipolar_metrics.py | pmeier/kornia | 57f5aeb605d0c69de88a0a1aa1563cee52d4bfaf | [
"ECL-2.0",
"Apache-2.0"
] | 5 | 2021-04-15T01:20:01.000Z | 2022-01-12T14:12:54.000Z | test/geometry/epipolar/test_epipolar_metrics.py | pmeier/kornia | 57f5aeb605d0c69de88a0a1aa1563cee52d4bfaf | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | test/geometry/epipolar/test_epipolar_metrics.py | pmeier/kornia | 57f5aeb605d0c69de88a0a1aa1563cee52d4bfaf | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2021-05-15T03:22:24.000Z | 2021-05-15T03:22:24.000Z | import pytest
import torch
from torch.autograd import gradcheck
from torch.testing import assert_allclose
import kornia.geometry.epipolar as epi
import kornia.testing as utils
class TestSymmetricalEpipolarDistance:
def test_smoke(self, device, dtype):
pts1 = torch.rand(1, 4, 3, device=device, dtype=dty... | 45.728814 | 118 | 0.693477 | import pytest
import torch
from torch.autograd import gradcheck
from torch.testing import assert_allclose
import kornia.geometry.epipolar as epi
import kornia.testing as utils
class TestSymmetricalEpipolarDistance:
def test_smoke(self, device, dtype):
pts1 = torch.rand(1, 4, 3, device=device, dtype=dty... | true | true |
1c04fbe787107ae00d3a690e32ffe486f5dc32dc | 765 | py | Python | lambkin/virtualenv.py | perezbarbosa/lambkin | f6016203c9565f150afcddfe25548fb084d03a8d | [
"Apache-2.0"
] | 81 | 2016-08-22T15:41:37.000Z | 2021-04-15T14:38:12.000Z | lambkin/virtualenv.py | perezbarbosa/lambkin | f6016203c9565f150afcddfe25548fb084d03a8d | [
"Apache-2.0"
] | 15 | 2016-08-29T18:40:03.000Z | 2017-11-29T10:31:45.000Z | lambkin/virtualenv.py | perezbarbosa/lambkin | f6016203c9565f150afcddfe25548fb084d03a8d | [
"Apache-2.0"
] | 14 | 2016-09-10T12:57:13.000Z | 2019-12-17T04:53:41.000Z | import os
from click import ClickException
from subprocess import call, check_output
from os.path import join
def have_virtualenv():
try:
with open(os.devnull, 'w') as null:
status = call(['virtualenv', '--help'], stdout=null, stderr=null)
return status is 0
except OSError:
... | 28.333333 | 77 | 0.678431 | import os
from click import ClickException
from subprocess import call, check_output
from os.path import join
def have_virtualenv():
try:
with open(os.devnull, 'w') as null:
status = call(['virtualenv', '--help'], stdout=null, stderr=null)
return status is 0
except OSError:
... | true | true |
1c04fd95ddd1314e2ab4e2dd880bbce320c3ce5f | 606 | py | Python | permutations/permutations.py | joaojunior/hackerrank | a5ee0449e791535930b8659dfb7dddcf9e1237de | [
"MIT"
] | null | null | null | permutations/permutations.py | joaojunior/hackerrank | a5ee0449e791535930b8659dfb7dddcf9e1237de | [
"MIT"
] | null | null | null | permutations/permutations.py | joaojunior/hackerrank | a5ee0449e791535930b8659dfb7dddcf9e1237de | [
"MIT"
] | 1 | 2019-06-19T00:51:02.000Z | 2019-06-19T00:51:02.000Z | from typing import List
class Solution:
def permute(self, nums: List[int]) -> List[List[int]]:
self.nums = nums
self.qty = len(nums) - 1
self.result = []
self.generate_permuation(0)
return self.result
def generate_permuation(self, i):
if i == self.qty:
... | 30.3 | 71 | 0.541254 | from typing import List
class Solution:
def permute(self, nums: List[int]) -> List[List[int]]:
self.nums = nums
self.qty = len(nums) - 1
self.result = []
self.generate_permuation(0)
return self.result
def generate_permuation(self, i):
if i == self.qty:
... | true | true |
1c04fe914397fbd6826c700616f867e52835b6f3 | 8,013 | py | Python | bibcat/__init__.py | KnowledgeLinks/bibcat | ed530401290865dcfefb2ae661a8880e52876a48 | [
"MIT"
] | 4 | 2018-02-13T20:36:29.000Z | 2019-09-26T14:38:25.000Z | bibcat/__init__.py | KnowledgeLinks/rdfw-bibcat | ed530401290865dcfefb2ae661a8880e52876a48 | [
"MIT"
] | 11 | 2017-10-27T17:44:46.000Z | 2018-08-15T17:27:25.000Z | bibcat/__init__.py | KnowledgeLinks/rdfw-bibcat | ed530401290865dcfefb2ae661a8880e52876a48 | [
"MIT"
] | 1 | 2017-01-23T19:52:01.000Z | 2017-01-23T19:52:01.000Z | """BIBCAT is a RDF-based Bibliographic Catalog"""
import datetime
import re
import urllib.parse
import pkg_resources
import rdflib
from rdflib.term import _is_valid_uri
from rdfframework.rml import RmlManager
from rdfframework.datamanager import DefinitionManager, DatastoreManager
from rdfframework.datatypes import Rdf... | 36.589041 | 79 | 0.579433 | import datetime
import re
import urllib.parse
import pkg_resources
import rdflib
from rdflib.term import _is_valid_uri
from rdfframework.rml import RmlManager
from rdfframework.datamanager import DefinitionManager, DatastoreManager
from rdfframework.datatypes import RdfNsManager
import pdb
import bibcat.sparql
__autho... | true | true |
1c04fe9833c13fd52527f7b477081ec2b694c1ec | 889 | py | Python | lab_2_conda/gui/window_4.py | AlexPraefectus/DM_Python | 45b465a63bf92f382ee375cf779652be422747e6 | [
"BSD-3-Clause"
] | 1 | 2018-04-25T20:18:41.000Z | 2018-04-25T20:18:41.000Z | lab_2_conda/gui/window_4.py | AlexPraefectus/DM_Python | 45b465a63bf92f382ee375cf779652be422747e6 | [
"BSD-3-Clause"
] | null | null | null | lab_2_conda/gui/window_4.py | AlexPraefectus/DM_Python | 45b465a63bf92f382ee375cf779652be422747e6 | [
"BSD-3-Clause"
] | null | null | null | from tkinter import Toplevel, Button
class Window4:
def __init__(self, parent):
self.win = Toplevel(parent)
self.win.geometry('600x600')
self.win.resizable(False, False)
self.win.withdraw()
self.but_intersection = Button(self.win, text='show intersection', font=20)
... | 44.45 | 83 | 0.642295 | from tkinter import Toplevel, Button
class Window4:
def __init__(self, parent):
self.win = Toplevel(parent)
self.win.geometry('600x600')
self.win.resizable(False, False)
self.win.withdraw()
self.but_intersection = Button(self.win, text='show intersection', font=20)
... | true | true |
1c04ff32af78966af112083d4bcdc56ee6c69f53 | 3,492 | py | Python | apps/system_apps/users_groups/main.py | hpagseddy/ZPUI | b82819e523987639c2dfab417f9895d7cd7ce049 | [
"Apache-2.0",
"MIT"
] | null | null | null | apps/system_apps/users_groups/main.py | hpagseddy/ZPUI | b82819e523987639c2dfab417f9895d7cd7ce049 | [
"Apache-2.0",
"MIT"
] | 2 | 2020-01-17T00:44:53.000Z | 2020-01-19T21:10:48.000Z | apps/system_apps/users_groups/main.py | hpagseddy/ZPUI | b82819e523987639c2dfab417f9895d7cd7ce049 | [
"Apache-2.0",
"MIT"
] | 1 | 2020-01-14T22:44:27.000Z | 2020-01-14T22:44:27.000Z | menu_name = "Users&groups"
import os
import pwd
from ui import Menu, UniversalInput, PrettyPrinter as Printer, DialogBox
from actions import FirstBootAction
from helpers import setup_logger
from libs.linux.passwd import passwd
logger = setup_logger(__name__, "warning")
i = None
o = None
context = None
home_dir = ... | 36.375 | 150 | 0.649198 | menu_name = "Users&groups"
import os
import pwd
from ui import Menu, UniversalInput, PrettyPrinter as Printer, DialogBox
from actions import FirstBootAction
from helpers import setup_logger
from libs.linux.passwd import passwd
logger = setup_logger(__name__, "warning")
i = None
o = None
context = None
home_dir = ... | true | true |
1c04ff38ad2c13eb069dd7c763de21f63f680c92 | 2,716 | py | Python | src/vesper/data/store/sqlite.py | onecommons/vesper | 818c09350b8fe53ea484aaff24deb1002a67f471 | [
"Apache-2.0"
] | null | null | null | src/vesper/data/store/sqlite.py | onecommons/vesper | 818c09350b8fe53ea484aaff24deb1002a67f471 | [
"Apache-2.0"
] | null | null | null | src/vesper/data/store/sqlite.py | onecommons/vesper | 818c09350b8fe53ea484aaff24deb1002a67f471 | [
"Apache-2.0"
] | null | null | null | #:copyright: Copyright 2009-2011 by the Vesper team, see AUTHORS.
#:license: Dual licenced under the GPL or Apache2 licences, see LICENSE.
__all__ = ['SqliteStore', 'TransactionSqliteStore']
import os, os.path
import logging
import sqlite3
from vesper.backports import *
from vesper.data.base import * # XXX
class Sq... | 30.177778 | 82 | 0.58137 | __all__ = ['SqliteStore', 'TransactionSqliteStore']
import os, os.path
import logging
import sqlite3
from vesper.backports import *
from vesper.data.base import *
class SqliteStore(Model):
def __init__(self, db_path=None, defaultStatements=None, **kw):
if db_path is None:
self.conn = s... | true | true |
1c050272f4aac3e61ea78c02c0dad7125ac1c08a | 1,372 | py | Python | rastervision/augmentor/nodata_augmentor_config.py | ValRat/raster-vision | 90f4c5d99869466c65fa972fa8f08f68c1102820 | [
"Apache-2.0"
] | 4 | 2019-03-11T12:38:15.000Z | 2021-04-06T14:57:52.000Z | rastervision/augmentor/nodata_augmentor_config.py | ValRat/raster-vision | 90f4c5d99869466c65fa972fa8f08f68c1102820 | [
"Apache-2.0"
] | null | null | null | rastervision/augmentor/nodata_augmentor_config.py | ValRat/raster-vision | 90f4c5d99869466c65fa972fa8f08f68c1102820 | [
"Apache-2.0"
] | 1 | 2021-02-25T18:23:27.000Z | 2021-02-25T18:23:27.000Z | from copy import deepcopy
import rastervision as rv
from rastervision.augmentor.nodata_augmentor import NodataAugmentor
from rastervision.augmentor.augmentor_config \
import (AugmentorConfig, AugmentorConfigBuilder)
from rastervision.protos.augmentor_pb2 import AugmentorConfig as AugmentorConfigMsg
class NodataA... | 29.826087 | 83 | 0.697522 | from copy import deepcopy
import rastervision as rv
from rastervision.augmentor.nodata_augmentor import NodataAugmentor
from rastervision.augmentor.augmentor_config \
import (AugmentorConfig, AugmentorConfigBuilder)
from rastervision.protos.augmentor_pb2 import AugmentorConfig as AugmentorConfigMsg
class NodataA... | true | true |
1c05042ea717d49a1c18a67d99c987653daf71b2 | 745 | py | Python | WebMirror/management/rss_parser_funcs/feed_parse_extractHutnovelBlogspotCom.py | fake-name/ReadableWebProxy | ed5c7abe38706acc2684a1e6cd80242a03c5f010 | [
"BSD-3-Clause"
] | 193 | 2016-08-02T22:04:35.000Z | 2022-03-09T20:45:41.000Z | WebMirror/management/rss_parser_funcs/feed_parse_extractHutnovelBlogspotCom.py | fake-name/ReadableWebProxy | ed5c7abe38706acc2684a1e6cd80242a03c5f010 | [
"BSD-3-Clause"
] | 533 | 2016-08-23T20:48:23.000Z | 2022-03-28T15:55:13.000Z | WebMirror/management/rss_parser_funcs/feed_parse_extractHutnovelBlogspotCom.py | rrosajp/ReadableWebProxy | ed5c7abe38706acc2684a1e6cd80242a03c5f010 | [
"BSD-3-Clause"
] | 19 | 2015-08-13T18:01:08.000Z | 2021-07-12T17:13:09.000Z | def extractHutnovelBlogspotCom(item):
'''
Parser for 'hutnovel.blogspot.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('True Star', 'True Star', ... | 33.863636 | 104 | 0.571812 | def extractHutnovelBlogspotCom(item):
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('True Star', 'True Star', 'translated'),
('please start your ... | true | true |
1c050457c716c15e8b6da532a3fcc49200f5594f | 1,702 | py | Python | server/py_modules/MySQLDB.py | JJYDXFS/NewsSearchEngine | ff6187fafbd11f5e7579c44043a1d6844780879c | [
"MIT"
] | 1 | 2021-06-09T11:09:30.000Z | 2021-06-09T11:09:30.000Z | server/py_modules/MySQLDB.py | JJYDXFS/NewsSearchEngine | ff6187fafbd11f5e7579c44043a1d6844780879c | [
"MIT"
] | null | null | null | server/py_modules/MySQLDB.py | JJYDXFS/NewsSearchEngine | ff6187fafbd11f5e7579c44043a1d6844780879c | [
"MIT"
] | null | null | null | import pymysql
class MySQLDB:
def __new__(cls, host, user, password, database):
""" test connection """
try:
connect = pymysql.connect(host = host,
user = user,
password = password,
database = database)
... | 30.392857 | 91 | 0.485311 | import pymysql
class MySQLDB:
def __new__(cls, host, user, password, database):
try:
connect = pymysql.connect(host = host,
user = user,
password = password,
database = database)
except Exception as e:
... | true | true |
1c0506d5875a366b24cdb689d00e68c123f501f4 | 430 | py | Python | app/core/migrations/0005_recipe_image.py | ClickTravel-VincentCleaver/recipe-app-api | 09e05c853e8aee14f36a07d1aba6db5f12bc0b7d | [
"MIT"
] | null | null | null | app/core/migrations/0005_recipe_image.py | ClickTravel-VincentCleaver/recipe-app-api | 09e05c853e8aee14f36a07d1aba6db5f12bc0b7d | [
"MIT"
] | null | null | null | app/core/migrations/0005_recipe_image.py | ClickTravel-VincentCleaver/recipe-app-api | 09e05c853e8aee14f36a07d1aba6db5f12bc0b7d | [
"MIT"
] | null | null | null | # Generated by Django 3.2.6 on 2021-08-24 13:56
import core.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0004_recipe'),
]
operations = [
migrations.AddField(
model_name='recipe',
name='image',
... | 21.5 | 93 | 0.62093 |
import core.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0004_recipe'),
]
operations = [
migrations.AddField(
model_name='recipe',
name='image',
field=models.ImageField(null=True, up... | true | true |
1c0508ec3f501f7c2a6c5e83a5189d05b3a75a0a | 3,179 | py | Python | test/controller/src/utils.py | neomatrix369/plz | 12f05a8d071e9c1976c444d34161530ffa73eeae | [
"MIT"
] | 1 | 2020-09-06T16:35:27.000Z | 2020-09-06T16:35:27.000Z | test/controller/src/utils.py | neomatrix369/plz | 12f05a8d071e9c1976c444d34161530ffa73eeae | [
"MIT"
] | null | null | null | test/controller/src/utils.py | neomatrix369/plz | 12f05a8d071e9c1976c444d34161530ffa73eeae | [
"MIT"
] | null | null | null | import os
from typing import Tuple, Optional
from plz.cli.configuration import Configuration
from plz.cli.controller_proxy import ControllerProxy
from plz.cli.run_execution_operation import RunExecutionOperation
from plz.cli.server import Server
from plz.controller.api import Controller
from plz.cli.snapshot import c... | 37.4 | 79 | 0.712488 | import os
from typing import Tuple, Optional
from plz.cli.configuration import Configuration
from plz.cli.controller_proxy import ControllerProxy
from plz.cli.run_execution_operation import RunExecutionOperation
from plz.cli.server import Server
from plz.controller.api import Controller
from plz.cli.snapshot import c... | true | true |
1c0509f7165225699f6553a563bd022100de1d17 | 1,796 | py | Python | 10.Algorithms_Data_Structure/01.Intro_BinarySearch/binary_search.py | cuicaihao/Data_Science_Python | ca4cb64bf9afc1011c192586362d0dd036e9441e | [
"MIT"
] | 2 | 2018-04-26T12:11:41.000Z | 2018-10-09T19:37:57.000Z | 10.Algorithms_Data_Structure/01.Intro_BinarySearch/binary_search.py | cuicaihao/Data_Science_Python | ca4cb64bf9afc1011c192586362d0dd036e9441e | [
"MIT"
] | null | null | null | 10.Algorithms_Data_Structure/01.Intro_BinarySearch/binary_search.py | cuicaihao/Data_Science_Python | ca4cb64bf9afc1011c192586362d0dd036e9441e | [
"MIT"
] | 4 | 2018-10-09T19:37:59.000Z | 2021-01-23T11:31:16.000Z | class BinarySearch():
def search_iterative(self, list, item):
# low and high keep track of which part of the list you'll search in.
low = 0
high = len(list) - 1
# While you haven't narrowed it down to one element ...
while low <= high:
# ... check the middle ele... | 29.933333 | 80 | 0.522272 | class BinarySearch():
def search_iterative(self, list, item):
low = 0
high = len(list) - 1
# While you haven't narrowed it down to one element ...
while low <= high:
mid = (low + high) // 2
guess = list[mid]
if gue... | true | true |
1c050ab0e7a807387f20e539c16e4fff297236fd | 572 | py | Python | seedstar_django_challenge/task1/forms.py | sisqology/seedstar_django_challenge | 83062eede010a12e06619e8e8c4adcdab0c89a80 | [
"MIT"
] | null | null | null | seedstar_django_challenge/task1/forms.py | sisqology/seedstar_django_challenge | 83062eede010a12e06619e8e8c4adcdab0c89a80 | [
"MIT"
] | null | null | null | seedstar_django_challenge/task1/forms.py | sisqology/seedstar_django_challenge | 83062eede010a12e06619e8e8c4adcdab0c89a80 | [
"MIT"
] | null | null | null | from django import forms
from django.core.validators import validate_email
from .models import Users
class UserForm(forms.Form):
name = forms.CharField(label='Name', max_length=200, widget=forms.TextInput(attrs={'class': 'form-control'}))
email = forms.EmailField(label='Email', max_length=60, widget=forms.Tex... | 38.133333 | 115 | 0.70979 | from django import forms
from django.core.validators import validate_email
from .models import Users
class UserForm(forms.Form):
name = forms.CharField(label='Name', max_length=200, widget=forms.TextInput(attrs={'class': 'form-control'}))
email = forms.EmailField(label='Email', max_length=60, widget=forms.Tex... | true | true |
1c050b12c972cfa7e23316805b15630c9455b91f | 2,506 | py | Python | data/p4VQE/R2/benchmark/startQiskit_QC36.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p4VQE/R2/benchmark/startQiskit_QC36.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p4VQE/R2/benchmark/startQiskit_QC36.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=3
# total number=10
import numpy as np
from qiskit import QuantumCircuit, execute, Aer, QuantumRegister, ClassicalRegister, transpile, BasicAer, IBMQ
import networkx as nx
from qiskit.visualization import plot_histogram
from typing import *
from pprint import pprint
from math import log2
from collectio... | 27.23913 | 118 | 0.634078 |
import numpy as np
from qiskit import QuantumCircuit, execute, Aer, QuantumRegister, ClassicalRegister, transpile, BasicAer, IBMQ
import networkx as nx
from qiskit.visualization import plot_histogram
from typing import *
from pprint import pprint
from math import log2
from collections import Counter
from qiskit.test.... | true | true |
1c050c145a3495f28c4e2020d44e9064d088f022 | 3,815 | py | Python | examples/addresses/move_destination_to_route.py | route4me/route4me-python-sdk | e2136c54e1ec5ed518f8eb94d5883486e0ec3afd | [
"0BSD"
] | 10 | 2016-10-17T07:14:05.000Z | 2021-12-05T02:54:41.000Z | examples/addresses/move_destination_to_route.py | route4me/route4me-python-sdk | e2136c54e1ec5ed518f8eb94d5883486e0ec3afd | [
"0BSD"
] | 14 | 2017-02-26T23:52:00.000Z | 2017-09-16T19:28:49.000Z | examples/addresses/move_destination_to_route.py | route4me/route4me-python-sdk | e2136c54e1ec5ed518f8eb94d5883486e0ec3afd | [
"0BSD"
] | 8 | 2017-02-23T14:27:07.000Z | 2020-05-23T14:23:55.000Z | # -*- coding: utf-8 -*-
from route4me import Route4Me
from route4me.constants import (
ALGORITHM_TYPE,
OPTIMIZE,
DISTANCE_UNIT,
DEVICE_TYPE,
TRAVEL_MODE,
)
API_KEY = "11111111111111111111111111111111"
# codebeat:disable[LOC, ABC]
def main():
r4m = Route4Me(API_KEY)
optimization = r4m.o... | 27.25 | 72 | 0.593971 |
from route4me import Route4Me
from route4me.constants import (
ALGORITHM_TYPE,
OPTIMIZE,
DISTANCE_UNIT,
DEVICE_TYPE,
TRAVEL_MODE,
)
API_KEY = "11111111111111111111111111111111"
def main():
r4m = Route4Me(API_KEY)
optimization = r4m.optimization
address = r4m.address
optimizatio... | true | true |
1c050cb3e2e0781309ee507f94abdb86f702c107 | 447 | py | Python | data/scripts/templates/object/static/item/shared_item_con_winebottle_02.py | obi-two/GameServer | 7d37024e2291a97d49522610cd8f1dbe5666afc2 | [
"MIT"
] | 20 | 2015-02-23T15:11:56.000Z | 2022-03-18T20:56:48.000Z | data/scripts/templates/object/static/item/shared_item_con_winebottle_02.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | null | null | null | data/scripts/templates/object/static/item/shared_item_con_winebottle_02.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | 20 | 2015-04-04T16:35:59.000Z | 2022-03-24T14:54:37.000Z | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Static()
result.template = "object/static/item/shared_item_con_winebottle_02.iff"
result.attribute_template_id = ... | 26.294118 | 73 | 0.727069 |
from swgpy.object import *
def create(kernel):
result = Static()
result.template = "object/static/item/shared_item_con_winebottle_02.iff"
result.attribute_template_id = -1
result.stfName("obj_n","unknown_object")
return result | true | true |
1c050d1e485b8dbc90a520b96a313d8d24139b63 | 3,335 | py | Python | python/paddle/fluid/tests/unittests/ipu/test_print_op_ipu.py | L-Net-1992/Paddle | 4d0ca02ba56760b456f3d4b42a538555b9b6c307 | [
"Apache-2.0"
] | 11 | 2016-08-29T07:43:26.000Z | 2016-08-29T07:51:24.000Z | python/paddle/fluid/tests/unittests/ipu/test_print_op_ipu.py | L-Net-1992/Paddle | 4d0ca02ba56760b456f3d4b42a538555b9b6c307 | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/tests/unittests/ipu/test_print_op_ipu.py | L-Net-1992/Paddle | 4d0ca02ba56760b456f3d4b42a538555b9b6c307 | [
"Apache-2.0"
] | 1 | 2021-12-09T08:59:17.000Z | 2021-12-09T08:59:17.000Z | # Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 29.513274 | 74 | 0.626987 |
import unittest
import numpy as np
import paddle
import paddle.static
from paddle.fluid.tests.unittests.ipu.op_test_ipu import IPUOpTest
@unittest.skipIf(not paddle.is_compiled_with_ipu(),
"core is not compiled with IPU")
class TestBase(IPUOpTest):
def setUp(self):
self.set_atol()
... | true | true |
1c050d42f2eea3279c18e43d818e7ca6d116b1bd | 18 | py | Python | src/server/controllers/__init__.py | ffyuanda/Involution | be4c769c5395fb6bd0f9158026b035ee29f52347 | [
"Apache-2.0"
] | null | null | null | src/server/controllers/__init__.py | ffyuanda/Involution | be4c769c5395fb6bd0f9158026b035ee29f52347 | [
"Apache-2.0"
] | 9 | 2021-10-10T08:06:01.000Z | 2021-11-11T15:17:15.000Z | src/server/controllers/__init__.py | ffyuanda/Involution | be4c769c5395fb6bd0f9158026b035ee29f52347 | [
"Apache-2.0"
] | 1 | 2021-10-10T14:01:59.000Z | 2021-10-10T14:01:59.000Z | from . import *
| 4.5 | 15 | 0.555556 | from . import *
| true | true |
1c050e924e0ac93f17e67b6de412c652a0c877a9 | 4,124 | py | Python | src/bin/main_baseline_lstm_test.py | lhf-labs/finance-news-analysis-bert | 8e3d1b2eb2a2b7390d53506329775fe83656c498 | [
"MIT",
"Unlicense"
] | 20 | 2021-11-03T00:33:48.000Z | 2022-02-16T07:29:14.000Z | src/bin/main_baseline_lstm_test.py | lhf-labs/finance-news-analysis-bert | 8e3d1b2eb2a2b7390d53506329775fe83656c498 | [
"MIT",
"Unlicense"
] | 3 | 2021-12-04T09:22:55.000Z | 2021-12-30T20:20:19.000Z | src/bin/main_baseline_lstm_test.py | lhf-labs/finance-news-analysis-bert | 8e3d1b2eb2a2b7390d53506329775fe83656c498 | [
"MIT",
"Unlicense"
] | null | null | null | import os
import git
import time
import torch
import logging
import argparse
import numpy as np
from controller.data import load_data_test
from controller.model import prepare_device, prepare_preliminary, train_model, test_model
from model.baseline_lstm_classifier import BaselineLSTMClassifier
"""
Train and test a giv... | 52.202532 | 118 | 0.698109 | import os
import git
import time
import torch
import logging
import argparse
import numpy as np
from controller.data import load_data_test
from controller.model import prepare_device, prepare_preliminary, train_model, test_model
from model.baseline_lstm_classifier import BaselineLSTMClassifier
if __name__ == '__main__... | true | true |
1c050f0fc9be58440276fbd285e2e36f7c7e1eb6 | 1,537 | py | Python | reservations/migrations/0001_initial.py | ispmor/space_reservation_system | 459843c94bad82110a532db6e16d1075bc88f39b | [
"MIT"
] | null | null | null | reservations/migrations/0001_initial.py | ispmor/space_reservation_system | 459843c94bad82110a532db6e16d1075bc88f39b | [
"MIT"
] | 23 | 2019-07-27T10:21:17.000Z | 2022-02-10T08:39:12.000Z | reservations/migrations/0001_initial.py | ispmor/space_reservation_system | 459843c94bad82110a532db6e16d1075bc88f39b | [
"MIT"
] | 1 | 2019-05-19T21:37:40.000Z | 2019-05-19T21:37:40.000Z | # Generated by Django 2.2 on 2019-08-24 12:50
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
('rooms', '0001_initial'),
migrations.swappable_depende... | 45.205882 | 197 | 0.643461 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
('rooms', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
oper... | true | true |
1c050fc187d568f7331a292aab231a6246fadbc6 | 9,315 | py | Python | Collections-a-installer/community-general-2.4.0/plugins/modules/notification/irc.py | d-amien-b/simple-getwordpress | da90d515a0aa837b633d50db4d91d22b031c04a2 | [
"MIT"
] | 1 | 2020-12-23T13:27:39.000Z | 2020-12-23T13:27:39.000Z | Collections-a-installer/community-general-2.4.0/plugins/modules/notification/irc.py | d-amien-b/simple-getwordpress | da90d515a0aa837b633d50db4d91d22b031c04a2 | [
"MIT"
] | null | null | null | Collections-a-installer/community-general-2.4.0/plugins/modules/notification/irc.py | d-amien-b/simple-getwordpress | da90d515a0aa837b633d50db4d91d22b031c04a2 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Jan-Piet Mens <jpmens () gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
module: irc
short_descr... | 30.641447 | 160 | 0.569404 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
module: irc
short_description: Send a message to an IRC channel or a nick
description:
- Send a message to an IRC channel or a nick. This is a very simplistic implementation.
options:
server:
type:... | true | true |
1c0510122b489e253b2f3a6cb487c06e9c4ea37f | 1,506 | py | Python | aioredis_wrapper/redis.py | waves-trading/aioredis_wrapper | fb466103b23b684f3ef8c42e2e02d06088f94ea0 | [
"MIT"
] | null | null | null | aioredis_wrapper/redis.py | waves-trading/aioredis_wrapper | fb466103b23b684f3ef8c42e2e02d06088f94ea0 | [
"MIT"
] | null | null | null | aioredis_wrapper/redis.py | waves-trading/aioredis_wrapper | fb466103b23b684f3ef8c42e2e02d06088f94ea0 | [
"MIT"
] | null | null | null | """"""
from typing import Optional
# from aioredis import create_redis, create_redis_pool
from aioredis import Redis
class RedisConnection(object):
"""
Class for async redis connection context manager.
"""
def __init__(
self,
*_,
host: str = "127.0.0.1",
... | 25.965517 | 57 | 0.543825 |
from typing import Optional
from aioredis import Redis
class RedisConnection(object):
def __init__(
self,
*_,
host: str = "127.0.0.1",
port: int = 6379,
password: Optional[str] = None,
db: int = 0,
timeout: int = 2,
... | true | true |
1c051037463b388d84b8039dc2fa92ef775cded7 | 811 | py | Python | AutomatedFinances/test/report_test.py | albert118/NET-AutomatedFinances | 651d736c8930d11cf449660b8ad7ff41938bd23a | [
"MIT"
] | null | null | null | AutomatedFinances/test/report_test.py | albert118/NET-AutomatedFinances | 651d736c8930d11cf449660b8ad7ff41938bd23a | [
"MIT"
] | 10 | 2020-07-08T07:51:24.000Z | 2022-01-13T03:00:34.000Z | test/report_test.py | albert118/Automated-Finances | aeb975e217faaa817e392c7e5eb8ece04701da84 | [
"MIT"
] | null | null | null | import unittest
from unittest import expectedFailure, TestCase
from src.accountdata import AccountData
import pandas as pd
import os
from src.report import Report
from datetime import datetime
class TestReportGeneration(TestCase):
def setUp(self):
self.df = pd.read_csv(os.path.join("test","testData.cs... | 36.863636 | 129 | 0.7164 | import unittest
from unittest import expectedFailure, TestCase
from src.accountdata import AccountData
import pandas as pd
import os
from src.report import Report
from datetime import datetime
class TestReportGeneration(TestCase):
def setUp(self):
self.df = pd.read_csv(os.path.join("test","testData.cs... | true | true |
1c0511b5a8489d2043215238ca0952c0823da1e8 | 351 | py | Python | rosalesjahaziel/0001/0001.py | saurabh896/python-1 | f8d3aedf4c0fe6e24dfa3269ea7e642c9f7dd9b7 | [
"MIT"
] | 3,976 | 2015-01-01T15:49:39.000Z | 2022-03-31T03:47:56.000Z | rosalesjahaziel/0001/0001.py | dwh65416396/python | 1a7e3edd1cd3422cc0eaa55471a0b42e004a9a1a | [
"MIT"
] | 97 | 2015-01-11T02:59:46.000Z | 2022-03-16T14:01:56.000Z | rosalesjahaziel/0001/0001.py | dwh65416396/python | 1a7e3edd1cd3422cc0eaa55471a0b42e004a9a1a | [
"MIT"
] | 3,533 | 2015-01-01T06:19:30.000Z | 2022-03-28T13:14:54.000Z | import random
import string
# this method use the 'key' to select 10 random characters
def generateCode(count):
for code in range(count):
key = string.upper('0123456789abcefghijklmnopqrstuvwxyz')
code = string.join(random.sample(key, 10))
print(code)
generateCode(10) # generate the amo... | 27 | 68 | 0.709402 | import random
import string
def generateCode(count):
for code in range(count):
key = string.upper('0123456789abcefghijklmnopqrstuvwxyz')
code = string.join(random.sample(key, 10))
print(code)
generateCode(10) | true | true |
1c05125d21564360429ea72c16eb9be1727f245b | 9,280 | py | Python | Main.py | 0xmmalik/BudgetSim | d6671544b23bee0b1314d6689b0581240d34d9d4 | [
"MIT"
] | 2 | 2019-10-12T17:02:38.000Z | 2020-08-20T01:59:15.000Z | Main.py | 0xmmalik/BudgetSIM | d6671544b23bee0b1314d6689b0581240d34d9d4 | [
"MIT"
] | null | null | null | Main.py | 0xmmalik/BudgetSIM | d6671544b23bee0b1314d6689b0581240d34d9d4 | [
"MIT"
] | null | null | null | #####################
# IMPORT STATEMENTS #
#####################
import pygame
assert pygame.init() == (6, 0)
from pygame.locals import *
from random import random, randint
import webbrowser
from time import sleep
##########
# IMAGES #
##########
load = pygame.image.load
screen1 = load("img/screen1.png")
instru... | 40.17316 | 228 | 0.555927 | import pygame
assert pygame.init() == (6, 0)
from pygame.locals import *
from random import random, randint
import webbrowser
from time import sleep
load = pygame.image.load
screen1 = load("img/screen1.png")
instructions = load("img/instructions.png")
excellent = load("img/excellent.png")
good = load("img/good.png")... | true | true |
1c051286297c483aabd423490cc2f1a5cb113a2a | 270 | py | Python | foo2.py | ValentynaGorbachenko/testpython | 793a2fb7396b50ed0537c4b6d9eea0cec8ded343 | [
"MIT"
] | null | null | null | foo2.py | ValentynaGorbachenko/testpython | 793a2fb7396b50ed0537c4b6d9eea0cec8ded343 | [
"MIT"
] | null | null | null | foo2.py | ValentynaGorbachenko/testpython | 793a2fb7396b50ed0537c4b6d9eea0cec8ded343 | [
"MIT"
] | null | null | null | # foo2.py
def functionA():
print(" a1")
from foo2 import functionB
print(" a2")
functionB()
print(" a3")
def functionB():
print(" b")
print(" t1")
if __name__ == "__main__":
print(" m1")
functionA()
print(" m2")
print(" t2") | 15.882353 | 30 | 0.533333 | def functionA():
print(" a1")
from foo2 import functionB
print(" a2")
functionB()
print(" a3")
def functionB():
print(" b")
print(" t1")
if __name__ == "__main__":
print(" m1")
functionA()
print(" m2")
print(" t2") | true | true |
1c05132fc9fd659f9316da4b5d989be6fa4ca2ca | 938 | py | Python | DataUtils/pickle_test.py | bamtercelboo/pytorch_NER_PosTag_BiLSTM_CRF | 375d00155baa2e0937c050562926bd0f2cd0a0f5 | [
"Apache-2.0"
] | 313 | 2018-09-10T01:29:30.000Z | 2022-03-29T09:22:21.000Z | DataUtils/pickle_test.py | bamtercelboo/pytorch_NER_PosTag_BiLSTM_CRF | 375d00155baa2e0937c050562926bd0f2cd0a0f5 | [
"Apache-2.0"
] | 20 | 2018-09-28T01:27:17.000Z | 2021-05-11T07:27:33.000Z | DataUtils/pickle_test.py | bamtercelboo/pytorch_NER_PosTag_BiLSTM_CRF | 375d00155baa2e0937c050562926bd0f2cd0a0f5 | [
"Apache-2.0"
] | 84 | 2018-10-23T10:06:49.000Z | 2022-03-29T09:22:16.000Z | # @Author : bamtercelboo
# @Datetime : 2018/8/23 14:17
# @File : pickle_test.py
# @Last Modify Time : 2018/8/23 14:17
# @Contact : bamtercelboo@{gmail.com, 163.com}
"""
FILE : pickle_test.py
FUNCTION : None
"""
import pickle
from Pickle import pcl
class P(object):
def __init__(self):
# print("... | 19.957447 | 56 | 0.576759 |
import pickle
from Pickle import pcl
class P(object):
def __init__(self):
self.word2id = {"I": 1, "love": 2, "Beijing": 3}
self.id2word = [1, 2, 3]
self.mincount = 3
w = P()
l = P()
d = [w, l, 1, 2, 3, 4]
print(w, l)
path = "../alphabet.pkl"
data = pcl.load(path)
print(data)
| true | true |
1c051330e039735d8701ee5e7a2e0ae28737144b | 413 | py | Python | Django2.0-Python-Full-Stack-Web-Developer/17-Django_Level_Four/learning_templates/learning_templates/wsgi.py | nobodysshadow/udemy_django | ff564d5d03f579be80ba03ae85230a1f19321e31 | [
"MIT"
] | null | null | null | Django2.0-Python-Full-Stack-Web-Developer/17-Django_Level_Four/learning_templates/learning_templates/wsgi.py | nobodysshadow/udemy_django | ff564d5d03f579be80ba03ae85230a1f19321e31 | [
"MIT"
] | null | null | null | Django2.0-Python-Full-Stack-Web-Developer/17-Django_Level_Four/learning_templates/learning_templates/wsgi.py | nobodysshadow/udemy_django | ff564d5d03f579be80ba03ae85230a1f19321e31 | [
"MIT"
] | null | null | null | """
WSGI config for learning_templates project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("D... | 24.294118 | 78 | 0.79661 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "learning_templates.settings")
application = get_wsgi_application()
| true | true |
1c0513990e547efc5b3d60658540d3254508c997 | 10,071 | py | Python | tripleoclient/v1/overcloud_backup.py | paramite/python-tripleoclient | 2d7cf1b8061eaaf6fc4b31be4490586a1f80133d | [
"Apache-2.0"
] | 39 | 2015-09-08T14:34:36.000Z | 2022-02-20T21:00:44.000Z | tripleoclient/v1/overcloud_backup.py | paramite/python-tripleoclient | 2d7cf1b8061eaaf6fc4b31be4490586a1f80133d | [
"Apache-2.0"
] | 1 | 2021-02-28T06:06:29.000Z | 2021-02-28T06:06:29.000Z | tripleoclient/v1/overcloud_backup.py | paramite/python-tripleoclient | 2d7cf1b8061eaaf6fc4b31be4490586a1f80133d | [
"Apache-2.0"
] | 33 | 2015-10-01T17:53:04.000Z | 2022-03-10T11:50:38.000Z | # Copyright 2020 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | 38.292776 | 79 | 0.503426 |
import argparse
import logging
import os
import yaml
from osc_lib.command import command
from osc_lib.i18n import _
from tripleoclient import constants
from tripleoclient import utils
LOG = logging.getLogger(__name__ + ".BackupOvercloud")
class BackupOvercloud(command.Command):
def get_parser(self, prog_name... | true | true |
1c051441c1727c1d199672cf8ba9597a42c277ef | 3,906 | py | Python | tests/utils/test_versions.py | tnadeau/incubator-ariatosca | de32028783969bc980144afa3c91061c7236459c | [
"Apache-2.0"
] | null | null | null | tests/utils/test_versions.py | tnadeau/incubator-ariatosca | de32028783969bc980144afa3c91061c7236459c | [
"Apache-2.0"
] | null | null | null | tests/utils/test_versions.py | tnadeau/incubator-ariatosca | de32028783969bc980144afa3c91061c7236459c | [
"Apache-2.0"
] | 1 | 2020-06-16T15:13:06.000Z | 2020-06-16T15:13:06.000Z | # -*- coding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "Lic... | 43.4 | 138 | 0.684332 |
from aria.utils.versions import (VersionString, parse_version_string)
def test_version_string():
assert VersionString('20') == VersionString('20')
assert VersionString('20') == VersionString('20.0')
assert VersionString('20') == VersionString('20.0.0')
assert VersionString('20') < VersionString('... | true | true |
1c0515364a82c57150bd17a763f2fc5035ba222c | 3,578 | py | Python | tests/ci/ssh.py | Cas-pian/ClickHouse | c5dfbfc6f54479a0eae79072ba9c5734a2ec833e | [
"Apache-2.0"
] | 5 | 2019-07-29T02:09:56.000Z | 2020-03-19T19:05:44.000Z | tests/ci/ssh.py | Cas-pian/ClickHouse | c5dfbfc6f54479a0eae79072ba9c5734a2ec833e | [
"Apache-2.0"
] | 30 | 2021-10-01T00:08:14.000Z | 2021-12-06T13:13:12.000Z | tests/ci/ssh.py | Cas-pian/ClickHouse | c5dfbfc6f54479a0eae79072ba9c5734a2ec833e | [
"Apache-2.0"
] | 1 | 2021-06-03T10:40:43.000Z | 2021-06-03T10:40:43.000Z | #!/usr/bin/env python3
import shutil
import os
import subprocess
import tempfile
import logging
import signal
class SSHAgent:
def __init__(self):
self._env = {}
self._env_backup = {}
self._keys = {}
self.start()
@property
def pid(self):
return int(self._env["SSH_A... | 30.581197 | 143 | 0.562605 |
import shutil
import os
import subprocess
import tempfile
import logging
import signal
class SSHAgent:
def __init__(self):
self._env = {}
self._env_backup = {}
self._keys = {}
self.start()
@property
def pid(self):
return int(self._env["SSH_AGENT_PID"])
def st... | true | true |
1c0515f55b2b9d788473b1b52f369fc51d3c9187 | 5,689 | py | Python | example_binance_dex.py | unicorn-data-analysis/-unicorn-binance-websocket-api | 0dfeed666edda730e3cfb2726a50e87143a46ab1 | [
"MIT"
] | 61 | 2022-01-03T19:57:55.000Z | 2022-03-30T14:44:01.000Z | example_binance_dex.py | happysms/unicorn-binance-websocket-api | 7be6070b484828fbbc7fb6751a70da274c7b0508 | [
"MIT"
] | 31 | 2022-01-02T07:49:39.000Z | 2022-03-24T08:21:22.000Z | example_binance_dex.py | happysms/unicorn-binance-websocket-api | 7be6070b484828fbbc7fb6751a70da274c7b0508 | [
"MIT"
] | 19 | 2022-01-06T10:56:05.000Z | 2022-03-25T03:23:05.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# File: example_binance_dex.py
#
# Part of ‘UNICORN Binance WebSocket API’
# Project website: https://www.lucit.tech/unicorn-binance-websocket-api.html
# Github: https://github.com/LUCIT-Systems-and-Development/unicorn-binance-websocket-api
# Documentation: https://unico... | 50.345133 | 116 | 0.757602 |
from unicorn_binance_websocket_api.manager import BinanceWebSocketApiManager
import logging
import time
import threading
import os
logging.getLogger("unicorn_binance_websocket_api")
logging.basicConfig(level=logging.DEBUG,
filename=os.path.basename(__file__) + '.log',
format="... | true | true |
1c051617feeb713306dd62d62b4222cde6545a34 | 147 | py | Python | setup.py | Fokko/pre-commit-pytype | 44cae24b540c216c4cfa23f012f259b015dd140a | [
"MIT"
] | null | null | null | setup.py | Fokko/pre-commit-pytype | 44cae24b540c216c4cfa23f012f259b015dd140a | [
"MIT"
] | null | null | null | setup.py | Fokko/pre-commit-pytype | 44cae24b540c216c4cfa23f012f259b015dd140a | [
"MIT"
] | null | null | null |
from setuptools import setup
setup(
name='pre_commit_dummy_package',
version='0.0.0',
install_requires=['pytype==2020.8.28'],
)
| 14.7 | 43 | 0.659864 |
from setuptools import setup
setup(
name='pre_commit_dummy_package',
version='0.0.0',
install_requires=['pytype==2020.8.28'],
)
| true | true |
1c0516fc5bd48b1a14b03d16bf3d1d16e25e8765 | 8,341 | py | Python | server/python/app.py | Shadowport/stripe-payments-demo | 77900b722610318a140ca5f7c47c64672bb7e135 | [
"MIT"
] | null | null | null | server/python/app.py | Shadowport/stripe-payments-demo | 77900b722610318a140ca5f7c47c64672bb7e135 | [
"MIT"
] | null | null | null | server/python/app.py | Shadowport/stripe-payments-demo | 77900b722610318a140ca5f7c47c64672bb7e135 | [
"MIT"
] | null | null | null | #! /usr/bin/env python3.6
"""
app.py
Stripe Payments Demo. Created by Adrienne Dreyfus (@adrind).
This is our Flask server that handles requests from our Stripe checkout flow.
It has all the endpoints you need to accept payments.
Python 3.6 or newer required.
"""
import stripe
import json
import setup
import os
fr... | 34.899582 | 119 | 0.657115 |
import stripe
import json
import setup
import os
from inventory import Inventory
from stripe_types import Source
from flask import Flask, render_template, jsonify, request, send_from_directory
from dotenv import load_dotenv, find_dotenv
static_dir = f'{os.path.abspath(os.path.join(__file__ ,"../../.."))}/public'
ap... | true | true |
1c0518e7a35b0b5230a327bca54a3784269bb85b | 583 | py | Python | ransowares/key.py | f0xBr4z1l/ranso | 04493f170e05331b47f6296ba9b9fdc51be79541 | [
"Apache-2.0"
] | null | null | null | ransowares/key.py | f0xBr4z1l/ranso | 04493f170e05331b47f6296ba9b9fdc51be79541 | [
"Apache-2.0"
] | null | null | null | ransowares/key.py | f0xBr4z1l/ranso | 04493f170e05331b47f6296ba9b9fdc51be79541 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
import base64
from Crypto.Cipher import AES
import glob
key = "besthacker@@@@@@"
def decrypt_ranso(arq, key):
f = open(arq, "rb").read()
aes = AES.new(key , AES.MODE_ECB)
try:
decrypt = aes.decrypt(f)
nd = decrypt.decode().rstrip("@")
origi = base64.b64decode(nd)
... | 22.423077 | 45 | 0.574614 | import base64
from Crypto.Cipher import AES
import glob
key = "besthacker@@@@@@"
def decrypt_ranso(arq, key):
f = open(arq, "rb").read()
aes = AES.new(key , AES.MODE_ECB)
try:
decrypt = aes.decrypt(f)
nd = decrypt.decode().rstrip("@")
origi = base64.b64decode(nd)
f = open(... | true | true |
1c051964b51d5181ed85182acb4b87304d7f4fe3 | 5,134 | py | Python | fits2png_example/fits2png.py | Keck-DataReductionPipelines/keckdrpframework | 37796f4cce7baaf0f0801331ce91df91f04bd1cc | [
"BSD-3-Clause"
] | null | null | null | fits2png_example/fits2png.py | Keck-DataReductionPipelines/keckdrpframework | 37796f4cce7baaf0f0801331ce91df91f04bd1cc | [
"BSD-3-Clause"
] | null | null | null | fits2png_example/fits2png.py | Keck-DataReductionPipelines/keckdrpframework | 37796f4cce7baaf0f0801331ce91df91f04bd1cc | [
"BSD-3-Clause"
] | null | null | null | """
Test harness for DRP Framework
Created on 2019-09-05
@author skwok
"""
import sys
import os.path
import time
import argparse
import traceback
import logging
#from tools.interface import import_module
#import_module("keckdrpframework")
from keckdrpframework.core.framework import Framework
from keckdrpframework... | 39.492308 | 119 | 0.715232 |
import sys
import os.path
import time
import argparse
import traceback
import logging
from keckdrpframework.core.framework import Framework
from keckdrpframework.models.arguments import Arguments
from keckdrpframework.config.framework_config import ConfigClass
from keckdrpframework.utils.drpf_logger import getLogge... | true | true |
1c0519e6ea3a34e2a5845be87b8a9a9c9578eda7 | 1,645 | py | Python | molotov/tests/example8.py | jldiaz-uniovi/molotov | 137864eb4ca7301303af21aadadd3f735dd0d042 | [
"Apache-2.0"
] | 401 | 2017-01-25T13:42:37.000Z | 2022-03-27T21:29:18.000Z | molotov/tests/example8.py | jldiaz-uniovi/molotov | 137864eb4ca7301303af21aadadd3f735dd0d042 | [
"Apache-2.0"
] | 131 | 2017-01-19T20:34:40.000Z | 2022-03-02T12:49:32.000Z | molotov/tests/example8.py | jldiaz-uniovi/molotov | 137864eb4ca7301303af21aadadd3f735dd0d042 | [
"Apache-2.0"
] | 31 | 2017-01-26T01:18:55.000Z | 2022-03-25T15:11:42.000Z | """
This Molotov script uses events to generate a success/failure output
"""
import json
import molotov
import time
_T = {}
def _now():
return time.time() * 1000
@molotov.events()
async def record_time(event, **info):
if event == "scenario_start":
scenario = info["scenario"]
index = (info... | 28.362069 | 68 | 0.45228 | import json
import molotov
import time
_T = {}
def _now():
return time.time() * 1000
@molotov.events()
async def record_time(event, **info):
if event == "scenario_start":
scenario = info["scenario"]
index = (info["wid"], scenario["name"])
_T[index] = _now()
if event == "scenario... | true | true |
1c051a5cc7be51d2a6780abb1f3ae18432614f7d | 9,895 | py | Python | scalene/scalene_parseargs.py | barseghyanartur/scalene | de49af11675caa1e79f29287c833db96e77d3cc6 | [
"Apache-2.0"
] | 1,708 | 2021-03-05T07:29:18.000Z | 2022-03-31T18:14:05.000Z | scalene/scalene_parseargs.py | barseghyanartur/scalene | de49af11675caa1e79f29287c833db96e77d3cc6 | [
"Apache-2.0"
] | 171 | 2021-03-05T14:37:30.000Z | 2022-03-30T15:15:38.000Z | scalene/scalene_parseargs.py | barseghyanartur/scalene | de49af11675caa1e79f29287c833db96e77d3cc6 | [
"Apache-2.0"
] | 58 | 2021-03-07T17:14:32.000Z | 2022-03-22T10:58:39.000Z | import argparse
import contextlib
import sys
from textwrap import dedent
from typing import Any, List, NoReturn, Optional, Tuple
from scalene.scalene_arguments import ScaleneArguments
from scalene.scalene_version import scalene_version
class RichArgParser(argparse.ArgumentParser):
def __init__(self, *args: Any, ... | 35.46595 | 139 | 0.565942 | import argparse
import contextlib
import sys
from textwrap import dedent
from typing import Any, List, NoReturn, Optional, Tuple
from scalene.scalene_arguments import ScaleneArguments
from scalene.scalene_version import scalene_version
class RichArgParser(argparse.ArgumentParser):
def __init__(self, *args: Any, ... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.