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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c264901d077ec604f58dea79c86874310032a5f | 14,011 | py | Python | dist-packages/pygtkcompat/generictreemodel.py | Jianwei-Wang/python2.7_lib | 911b8e81512e5ac5f13e669ab46f7693ed897378 | [
"PSF-2.0"
] | 3 | 2015-10-31T10:39:25.000Z | 2019-04-27T20:19:33.000Z | dist-packages/pygtkcompat/generictreemodel.py | Jianwei-Wang/python2.7_lib | 911b8e81512e5ac5f13e669ab46f7693ed897378 | [
"PSF-2.0"
] | null | null | null | dist-packages/pygtkcompat/generictreemodel.py | Jianwei-Wang/python2.7_lib | 911b8e81512e5ac5f13e669ab46f7693ed897378 | [
"PSF-2.0"
] | null | null | null | # -*- Mode: Python; py-indent-offset: 4 -*-
# generictreemodel - GenericTreeModel implementation for pygtk compatibility.
# Copyright (C) 2013 Simon Feltman
#
# generictreemodel.py: GenericTreeModel implementation for pygtk compatibility
#
# This library is free software; you can redistribute it and/or
# modify it un... | 33.439141 | 109 | 0.639783 |
import sys
import random
import collections
import ctypes
from gi.repository import GObject
from gi.repository import Gtk
class _CTreeIter(ctypes.Structure):
_fields_ = [('stamp', ctypes.c_int),
('user_data', ctypes.c_void_p),
('user_data2', ctypes.c_void_p),... | true | true |
1c264ac43a5f389b625f961b872cdca85ac616a3 | 412 | py | Python | pystreamable/exceptions.py | jernejovc/pystreamable | 78e342dd502bedac6214781bf4f4f85f5a444471 | [
"MIT"
] | 9 | 2017-08-09T19:29:16.000Z | 2021-11-29T02:50:24.000Z | pystreamable/exceptions.py | jernejovc/pystreamable | 78e342dd502bedac6214781bf4f4f85f5a444471 | [
"MIT"
] | 3 | 2017-10-11T18:41:05.000Z | 2018-10-22T09:04:12.000Z | pystreamable/exceptions.py | jernejovc/pystreamable | 78e342dd502bedac6214781bf4f4f85f5a444471 | [
"MIT"
] | 3 | 2019-08-25T13:17:25.000Z | 2021-01-22T18:11:10.000Z | from __future__ import print_function
class StreamableApiException(Exception):
"""
Base class for all Streamable API wrapper exceptions.
"""
pass
class StreamableApiServerException(StreamableApiException):
"""
Streamable API server exception.
"""
pass
class StreamableApiClientExcep... | 17.913043 | 59 | 0.711165 | from __future__ import print_function
class StreamableApiException(Exception):
pass
class StreamableApiServerException(StreamableApiException):
pass
class StreamableApiClientException(StreamableApiException):
pass
| true | true |
1c264ae56063f74d5007a841a4642daa2a600fdb | 4,921 | py | Python | tests/test_tasks.py | lsst/faro | c9d0b822c4e3533531fa3849ae4bb92545373db5 | [
"MIT"
] | null | null | null | tests/test_tasks.py | lsst/faro | c9d0b822c4e3533531fa3849ae4bb92545373db5 | [
"MIT"
] | 32 | 2021-03-05T17:13:30.000Z | 2022-03-28T19:48:28.000Z | tests/test_tasks.py | lsst/faro | c9d0b822c4e3533531fa3849ae4bb92545373db5 | [
"MIT"
] | 2 | 2021-02-11T06:00:58.000Z | 2021-02-19T23:11:30.000Z | # This file is part of faro.
#
# Developed for the LSST Data Management System.
# This product includes software developed by the LSST Project
# (https://www.lsst.org).
# See the COPYRIGHT file at the top-level directory of this distribution
# for details of code ownership.
#
# This program is free software: you can re... | 40.669421 | 104 | 0.682585 |
import os
import unittest
import astropy.units as u
from lsst.utils import getPackageDir
from lsst.afw.table import SimpleCatalog
from lsst.faro.base import CatalogMeasurementBaseConfig, CatalogMeasurementBaseTask, NumSourcesMergeTask
from lsst.faro.measurement import (VisitTableMeasurementConfig... | true | true |
1c264b310a18f7a643b6040b60e50403c0536e41 | 1,452 | py | Python | pipeline_dp/__init__.py | miracvbasaran/PipelineDP | 3b61bd909591da6448107f84f94b1ccd57939aff | [
"Apache-2.0"
] | 1 | 2022-02-11T04:32:47.000Z | 2022-02-11T04:32:47.000Z | pipeline_dp/__init__.py | miracvbasaran/PipelineDP | 3b61bd909591da6448107f84f94b1ccd57939aff | [
"Apache-2.0"
] | null | null | null | pipeline_dp/__init__.py | miracvbasaran/PipelineDP | 3b61bd909591da6448107f84f94b1ccd57939aff | [
"Apache-2.0"
] | 1 | 2022-03-18T17:19:32.000Z | 2022-03-18T17:19:32.000Z | # Copyright 2022 OpenMined.
#
# 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, ... | 45.375 | 74 | 0.844353 |
from pipeline_dp.aggregate_params import AggregateParams
from pipeline_dp.aggregate_params import CountParams
from pipeline_dp.aggregate_params import MechanismType
from pipeline_dp.aggregate_params import Metrics
from pipeline_dp.aggregate_params import NoiseKind
from pipeline_dp.aggregate_params import P... | true | true |
1c264c2756b8c4aec3859a567fa6e321866778fc | 2,120 | py | Python | hi-ml-histopathology/src/histopathology/datamodules/tcga_crck_module.py | kumar-pratik/hi-ml | a108cf4ea244a76127adedc0ca60f0a5afdfb3e8 | [
"MIT"
] | null | null | null | hi-ml-histopathology/src/histopathology/datamodules/tcga_crck_module.py | kumar-pratik/hi-ml | a108cf4ea244a76127adedc0ca60f0a5afdfb3e8 | [
"MIT"
] | null | null | null | hi-ml-histopathology/src/histopathology/datamodules/tcga_crck_module.py | kumar-pratik/hi-ml | a108cf4ea244a76127adedc0ca60f0a5afdfb3e8 | [
"MIT"
] | null | null | null | # ------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
# -------------------------------------------------------------------... | 51.707317 | 104 | 0.590094 |
from typing import Tuple, Any
from health_ml.utils.split_dataset import DatasetSplits
from histopathology.datamodules.base_module import TilesDataModule
from histopathology.datasets.tcga_crck_tiles_dataset import TcgaCrck_TilesDataset
class TcgaCrckTilesDataModule(TilesDataModule):
def __init__(self, **kw... | true | true |
1c264cae3ba3b355a256b7c10ff77d094e231a49 | 17,309 | py | Python | contrib/.venv/lib/python3.8/site-packages/bitcoinlib/values.py | jtatman/katersltc-client | 7ea88bfa32e9bdce9bf8d434a8909a07b65412f7 | [
"MIT"
] | null | null | null | contrib/.venv/lib/python3.8/site-packages/bitcoinlib/values.py | jtatman/katersltc-client | 7ea88bfa32e9bdce9bf8d434a8909a07b65412f7 | [
"MIT"
] | null | null | null | contrib/.venv/lib/python3.8/site-packages/bitcoinlib/values.py | jtatman/katersltc-client | 7ea88bfa32e9bdce9bf8d434a8909a07b65412f7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# BitcoinLib - Python Cryptocurrency Library
# VALUE class - representing cryptocurrency values
# © 2020 November - 1200 Web Development <http://1200wd.com/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General P... | 40.631455 | 328 | 0.616442 |
from bitcoinlib.networks import *
from bitcoinlib.config.config import NETWORK_DENOMINATORS
def value_to_satoshi(value, network=None):
if isinstance(value, str):
value = Value(value)
if isinstance(value, Value):
if network and value.network != network:
raise Val... | true | true |
1c264cdb5158db545dbd204bdafad9da92f5f12e | 11,801 | py | Python | recog_car_license_reshapevideo.py | qw85639229/Car_License_SVM | c5b0062e84e5000c7940b1d90cc7c63e52afed21 | [
"MIT"
] | 1 | 2020-04-20T07:56:07.000Z | 2020-04-20T07:56:07.000Z | recog_car_license_reshapevideo.py | qw85639229/Car_License_SVM | c5b0062e84e5000c7940b1d90cc7c63e52afed21 | [
"MIT"
] | null | null | null | recog_car_license_reshapevideo.py | qw85639229/Car_License_SVM | c5b0062e84e5000c7940b1d90cc7c63e52afed21 | [
"MIT"
] | null | null | null | #coding=UTF-8
import argparse
import logging
import os
import cv2
import numpy as np
import torch
from PIL import Image, ImageDraw, ImageFont
from torchvision import transforms
from OCR_For_Car_License.cnn import ConvNet_Car_License
from detect_car_license import detect_car_license
# import caffe
# from numpy.linalg ... | 34.708824 | 119 | 0.577324 |
import argparse
import logging
import os
import cv2
import numpy as np
import torch
from PIL import Image, ImageDraw, ImageFont
from torchvision import transforms
from OCR_For_Car_License.cnn import ConvNet_Car_License
from detect_car_license import detect_car_license
from predict_version_1_onlyforBLUE import Ca... | true | true |
1c264d0a487b051afcb9b6bbce1070cdc0541c53 | 37,799 | py | Python | azure/mgmt/resource/locks/v2015_01_01/operations/management_locks_operations.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 1 | 2022-01-25T22:52:58.000Z | 2022-01-25T22:52:58.000Z | azure/mgmt/resource/locks/v2015_01_01/operations/management_locks_operations.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | azure/mgmt/resource/locks/v2015_01_01/operations/management_locks_operations.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | # 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 ... | 48.899094 | 222 | 0.666843 |
import uuid
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError
from .. import models
class ManagementLocksOperations(object):
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serialize... | true | true |
1c264d1e6367d0f24f690d0cf19dc9bef218bb0a | 1,187 | py | Python | tests/integration/test_backward_compatability/test_short_strings_aggregation.py | ageraab/ClickHouse | 7cf35388407ee57f4e75c7040202274fea793ca2 | [
"Apache-2.0"
] | 8 | 2019-06-04T02:50:13.000Z | 2022-02-10T06:46:51.000Z | tests/integration/test_backward_compatability/test_short_strings_aggregation.py | ageraab/ClickHouse | 7cf35388407ee57f4e75c7040202274fea793ca2 | [
"Apache-2.0"
] | 16 | 2021-06-07T21:32:30.000Z | 2022-03-31T21:08:29.000Z | tests/integration/test_backward_compatability/test_short_strings_aggregation.py | ageraab/ClickHouse | 7cf35388407ee57f4e75c7040202274fea793ca2 | [
"Apache-2.0"
] | 2 | 2021-01-04T06:43:51.000Z | 2021-05-14T03:17:13.000Z | import pytest
import helpers.client as client
from helpers.cluster import ClickHouseCluster
cluster = ClickHouseCluster(__file__)
node1 = cluster.add_instance('node1', with_zookeeper=False, image='yandex/clickhouse-server:19.16.9.37', stay_alive=True, with_installed_binary=True)
node2 = cluster.add_instance('node2', ... | 40.931034 | 149 | 0.732098 | import pytest
import helpers.client as client
from helpers.cluster import ClickHouseCluster
cluster = ClickHouseCluster(__file__)
node1 = cluster.add_instance('node1', with_zookeeper=False, image='yandex/clickhouse-server:19.16.9.37', stay_alive=True, with_installed_binary=True)
node2 = cluster.add_instance('node2', ... | true | true |
1c264d61c350f269e7e1ef45bd501706a6257e5b | 7,644 | py | Python | dark/blast/hsp.py | UdoGi/dark-matter | 3d49e89fa5e81f83144119f6216c5774176d203b | [
"MIT"
] | null | null | null | dark/blast/hsp.py | UdoGi/dark-matter | 3d49e89fa5e81f83144119f6216c5774176d203b | [
"MIT"
] | null | null | null | dark/blast/hsp.py | UdoGi/dark-matter | 3d49e89fa5e81f83144119f6216c5774176d203b | [
"MIT"
] | null | null | null | def printHSP(hsp, indent=''):
for attr in ['bits', 'expect', 'frame', 'query_end', 'query_start',
'sbjct', 'query', 'sbjct_end', 'sbjct_start']:
print('%s%s: %s' % (indent, attr, hsp[attr]))
def normalizeHSP(hsp, readLen, blastApplication):
"""
Examine an HSP and return informatio... | 42.232044 | 77 | 0.665882 | def printHSP(hsp, indent=''):
for attr in ['bits', 'expect', 'frame', 'query_end', 'query_start',
'sbjct', 'query', 'sbjct_end', 'sbjct_start']:
print('%s%s: %s' % (indent, attr, hsp[attr]))
def normalizeHSP(hsp, readLen, blastApplication):
def debugPrint(locals, msg=None):
p... | true | true |
1c264f696e86218e49d800b9d90eeb55b526edc2 | 1,153 | py | Python | main_menu.py | acc-cosc-1336/cosc-1336-fall-2017-chaup92 | b6fa4f9757b364129367d137d2b37ff511ae85a3 | [
"MIT"
] | null | null | null | main_menu.py | acc-cosc-1336/cosc-1336-fall-2017-chaup92 | b6fa4f9757b364129367d137d2b37ff511ae85a3 | [
"MIT"
] | null | null | null | main_menu.py | acc-cosc-1336/cosc-1336-fall-2017-chaup92 | b6fa4f9757b364129367d137d2b37ff511ae85a3 | [
"MIT"
] | null | null | null | from tkinter import Menu
class MainMenu (Menu):
"""Main menu for the Contoso Application"""
def __init__(self, master=None, **kwargs):
Menu.__init__(self, master, **kwargs)
file_menu = Menu(self, tearoff = 0)
file_menu.add_command(label = "Save Data", command = lambda:self.... | 48.041667 | 112 | 0.661752 | from tkinter import Menu
class MainMenu (Menu):
def __init__(self, master=None, **kwargs):
Menu.__init__(self, master, **kwargs)
file_menu = Menu(self, tearoff = 0)
file_menu.add_command(label = "Save Data", command = lambda:self.master.save_data)
file_menu.add_command(... | true | true |
1c26501dc7fbcb4111ac603000904f3d06196ade | 2,926 | py | Python | faker/providers/company/th_TH/__init__.py | mgorny/faker | b1176e01bf4d7f1aef408a4bb96a9e46188cc113 | [
"MIT"
] | 12,077 | 2015-01-01T18:30:07.000Z | 2022-03-31T23:22:01.000Z | faker/providers/company/th_TH/__init__.py | mgorny/faker | b1176e01bf4d7f1aef408a4bb96a9e46188cc113 | [
"MIT"
] | 1,306 | 2015-01-03T05:18:55.000Z | 2022-03-31T02:43:04.000Z | faker/providers/company/th_TH/__init__.py | mgorny/faker | b1176e01bf4d7f1aef408a4bb96a9e46188cc113 | [
"MIT"
] | 1,855 | 2015-01-08T14:20:10.000Z | 2022-03-25T17:23:32.000Z | from collections import OrderedDict
from .. import Provider as CompanyProvider
class Provider(CompanyProvider):
formats = OrderedDict((
("{{company_limited_prefix}}{{last_name}} {{company_limited_suffix}}", 0.2),
("{{company_limited_prefix}}{{last_name}}{{company_suffix}} {{company_limited_suffix... | 25.666667 | 102 | 0.478127 | from collections import OrderedDict
from .. import Provider as CompanyProvider
class Provider(CompanyProvider):
formats = OrderedDict((
("{{company_limited_prefix}}{{last_name}} {{company_limited_suffix}}", 0.2),
("{{company_limited_prefix}}{{last_name}}{{company_suffix}} {{company_limited_suffix... | true | true |
1c2650898a604f8383a9f6011b02b18bfc1ede02 | 30,270 | py | Python | specVis_old.py | bgallag6/specFit | 60dc329b8a7f15c219245ecb2296aee8787cae93 | [
"MIT"
] | 1 | 2022-02-16T00:34:48.000Z | 2022-02-16T00:34:48.000Z | specVis_old.py | bgallag6/specFit | 60dc329b8a7f15c219245ecb2296aee8787cae93 | [
"MIT"
] | 5 | 2018-09-14T12:49:55.000Z | 2021-03-25T22:42:03.000Z | specVis_old.py | bgallag6/specFit | 60dc329b8a7f15c219245ecb2296aee8787cae93 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Nov 5 21:05:07 2018
@author: Brendan
"""
import matplotlib.pyplot as plt
import numpy as np
from scipy.optimize import curve_fit as Fit
import sunpy
import sunpy.cm
from scipy import fftpack
from matplotlib import cm
from mpl_toolkits.axes_grid1 import make_axes_locatable
f... | 32.548387 | 145 | 0.574199 |
import matplotlib.pyplot as plt
import numpy as np
from scipy.optimize import curve_fit as Fit
import sunpy
import sunpy.cm
from scipy import fftpack
from matplotlib import cm
from mpl_toolkits.axes_grid1 import make_axes_locatable
from matplotlib.widgets import Button, Slider
from scipy.stats import f as ff
from sci... | true | true |
1c2650aec476a3ec10d120feda58a3c2f0510949 | 1,266 | py | Python | pynetdicom/_config.py | drleq/pynetdicom | 06981f6c2b1a47e808c60f14cd28bfe7a1d49a99 | [
"MIT"
] | null | null | null | pynetdicom/_config.py | drleq/pynetdicom | 06981f6c2b1a47e808c60f14cd28bfe7a1d49a99 | [
"MIT"
] | null | null | null | pynetdicom/_config.py | drleq/pynetdicom | 06981f6c2b1a47e808c60f14cd28bfe7a1d49a99 | [
"MIT"
] | null | null | null | """pynetdicom configuration options"""
LOG_HANDLER_LEVEL = 'standard'
"""Default (non-user) event logging
* If ``'none'`` then events will not be logged at all, however there will still
be some logging (warnings, errors, etc)
* If ``'standard'`` then certain events will be logged (association
negotiation, DIMSE ... | 23.886792 | 79 | 0.736177 |
LOG_HANDLER_LEVEL = 'standard'
ENFORCE_UID_CONFORMANCE = False
USE_SHORT_DIMSE_AET = True
| true | true |
1c265250e56b6f3610127a085911fc5247a921c5 | 126 | py | Python | lib/solutions/HLO/hello_solution.py | DPNT-Sourcecode/CHK-jfco01 | b1442d0f5380bf877937b32608ba6ff4bf56a413 | [
"Apache-2.0"
] | null | null | null | lib/solutions/HLO/hello_solution.py | DPNT-Sourcecode/CHK-jfco01 | b1442d0f5380bf877937b32608ba6ff4bf56a413 | [
"Apache-2.0"
] | null | null | null | lib/solutions/HLO/hello_solution.py | DPNT-Sourcecode/CHK-jfco01 | b1442d0f5380bf877937b32608ba6ff4bf56a413 | [
"Apache-2.0"
] | null | null | null |
# noinspection PyUnusedLocal
# friend_name = unicode string
def hello(friend_name):
return "Hello, {}!".format(friend_name) | 21 | 40 | 0.761905 |
def hello(friend_name):
return "Hello, {}!".format(friend_name) | true | true |
1c2652d378326d8fe8fe0668704cd8f6b02d1a8c | 2,633 | py | Python | src/pset_utils/luigi/target.py | nhvinh118/pset-4-5 | 7927f122579264a7964243c932185f1bc2371045 | [
"MIT"
] | null | null | null | src/pset_utils/luigi/target.py | nhvinh118/pset-4-5 | 7927f122579264a7964243c932185f1bc2371045 | [
"MIT"
] | null | null | null | src/pset_utils/luigi/target.py | nhvinh118/pset-4-5 | 7927f122579264a7964243c932185f1bc2371045 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
""" This module supplements Luigi's atomic writing within its Target classes.
The subclassed method preserves the suffix of the output target in the temporary file.
"""
import io
import os
import random
import traceback
from contextlib import contextmanager
import luigi
from luigi.local... | 26.59596 | 107 | 0.717812 |
import io
import os
import random
import traceback
from contextlib import contextmanager
import luigi
from luigi.local_target import LocalTarget, atomic_file
from luigi.format import FileWrapper, get_default_format
class suffix_preserving_atomic_file(atomic_file):
def __init__(self, path=''):
super().__init__(pat... | true | true |
1c2653333eff1737a5cee28ffecbb67be6305e0d | 5,349 | py | Python | mlflow_export_import/run/import_run.py | yukihato/mlflow-export-import | 13f803b43229ab7cd0a922d206bb9fecc3880e57 | [
"Apache-2.0"
] | null | null | null | mlflow_export_import/run/import_run.py | yukihato/mlflow-export-import | 13f803b43229ab7cd0a922d206bb9fecc3880e57 | [
"Apache-2.0"
] | null | null | null | mlflow_export_import/run/import_run.py | yukihato/mlflow-export-import | 13f803b43229ab7cd0a922d206bb9fecc3880e57 | [
"Apache-2.0"
] | null | null | null | """
Imports a run from a directory.
"""
import os
import time
import yaml
import tempfile
import click
import mlflow
from mlflow_export_import import utils, click_doc
from mlflow_export_import import mk_local_path
from mlflow_export_import.common.find_artifacts import find_artifacts
from mlflow_export_import.common.h... | 49.527778 | 180 | 0.693214 |
import os
import time
import yaml
import tempfile
import click
import mlflow
from mlflow_export_import import utils, click_doc
from mlflow_export_import import mk_local_path
from mlflow_export_import.common.find_artifacts import find_artifacts
from mlflow_export_import.common.http_client import DatabricksHttpClient
f... | true | true |
1c26533cc498776b3f1fa3748d3e2c59f7aeed17 | 2,477 | py | Python | esphome/components/ina3221/sensor.py | huhuhugo1/esphome | eb895d2095861a4d51f1a5fcd582a97389c27b4f | [
"MIT"
] | null | null | null | esphome/components/ina3221/sensor.py | huhuhugo1/esphome | eb895d2095861a4d51f1a5fcd582a97389c27b4f | [
"MIT"
] | null | null | null | esphome/components/ina3221/sensor.py | huhuhugo1/esphome | eb895d2095861a4d51f1a5fcd582a97389c27b4f | [
"MIT"
] | null | null | null | import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import i2c, sensor
from esphome.const import CONF_BUS_VOLTAGE, CONF_CURRENT, CONF_ID, CONF_POWER, \
CONF_SHUNT_RESISTANCE, CONF_SHUNT_VOLTAGE, ICON_FLASH, \
UNIT_VOLT, UNIT_AMPERE, UNIT_WATT
DEPENDENCIES = ['i2c']
CONF... | 43.45614 | 92 | 0.711748 | import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import i2c, sensor
from esphome.const import CONF_BUS_VOLTAGE, CONF_CURRENT, CONF_ID, CONF_POWER, \
CONF_SHUNT_RESISTANCE, CONF_SHUNT_VOLTAGE, ICON_FLASH, \
UNIT_VOLT, UNIT_AMPERE, UNIT_WATT
DEPENDENCIES = ['i2c']
CONF... | true | true |
1c2653875cada3f36b1a5bcfa63b7c479cebf403 | 2,503 | py | Python | utils/code_generator/time_measurement/phase_2/execute_programs.py | zehor-l/tiramisu | 225b30d3495bee52c0e06ed7794f402f2e58de73 | [
"MIT"
] | 23 | 2017-05-03T13:06:34.000Z | 2018-06-07T07:12:43.000Z | utils/code_generator/time_measurement/phase_2/execute_programs.py | zehor-l/tiramisu | 225b30d3495bee52c0e06ed7794f402f2e58de73 | [
"MIT"
] | 2 | 2017-04-25T08:59:09.000Z | 2017-05-11T16:41:55.000Z | utils/code_generator/time_measurement/phase_2/execute_programs.py | zehor-l/tiramisu | 225b30d3495bee52c0e06ed7794f402f2e58de73 | [
"MIT"
] | 5 | 2017-02-16T14:26:40.000Z | 2018-05-30T16:49:27.000Z | """
Execute the programs and report execution times. For this script to work,
the wrappers must already be compiled.
This script accepts three parameters : start end job_id
It processes the programs in the range progs_list[start, end)
job_id is used to specify which job generated which list of execution times
The exe... | 32.506494 | 115 | 0.701958 |
import sys, pickle, subprocess
from pathlib import Path
start = int(sys.argv[1])
end = int(sys.argv[2])
job_id = int(sys.argv[3])
data_path = Path("wrappers")
progs_list_path = Path("progs_list.pickle")
dst_path = "results/parts/final_exec_times_%s_%s_%s_{}_{}.pickle" % (job_id, start, end)
nb_tests = 15
p... | true | true |
1c2653f2ff70637bebdc3c0036f647b08743e40d | 8,400 | py | Python | src/python/rnn_print_log.py | jnamika/rnn | de8e8b8642e7dd5a3925b0a1742dadbda00a54fb | [
"ISC"
] | 20 | 2015-07-26T22:25:50.000Z | 2019-09-29T12:48:21.000Z | src/python/rnn_print_log.py | jnamika/rnn | de8e8b8642e7dd5a3925b0a1742dadbda00a54fb | [
"ISC"
] | 2 | 2018-05-14T18:16:43.000Z | 2018-05-15T06:40:15.000Z | rnn/src/python/rnn_print_log.py | jnamika/mregn | 6a92a19e7891bdf51ce0f4d5b9c1710f0e97553c | [
"ISC"
] | 19 | 2015-01-06T16:24:08.000Z | 2019-10-20T04:41:02.000Z | # -*- coding:utf-8 -*-
import sys
import re
def tail_n(f, n=10, offset=0):
avg_length = 74
to_read = n + offset
while 1:
try:
f.seek(-int(avg_length * to_read), 2)
except IOError:
f.seek(0)
pos = f.tell()
lines = f.read().splitlines()
if len(... | 29.473684 | 75 | 0.513452 |
import sys
import re
def tail_n(f, n=10, offset=0):
avg_length = 74
to_read = n + offset
while 1:
try:
f.seek(-int(avg_length * to_read), 2)
except IOError:
f.seek(0)
pos = f.tell()
lines = f.read().splitlines()
if len(lines) > to_read or po... | true | true |
1c2653fec107c192e5817fc29d081c4a38033089 | 9,557 | py | Python | projectq/setups/decompositions/time_evolution_test.py | vm6502q/ProjectQ | 1eac4b1f529551dfc1668443eba0c68dee54120b | [
"Apache-2.0"
] | 1 | 2019-08-29T19:04:27.000Z | 2019-08-29T19:04:27.000Z | projectq/setups/decompositions/time_evolution_test.py | vm6502q/ProjectQ | 1eac4b1f529551dfc1668443eba0c68dee54120b | [
"Apache-2.0"
] | 6 | 2019-01-27T17:05:25.000Z | 2020-02-24T00:15:59.000Z | projectq/setups/decompositions/time_evolution_test.py | vm6502q/ProjectQ | 1eac4b1f529551dfc1668443eba0c68dee54120b | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 ProjectQ-Framework (www.projectq.ch)
#
# 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 app... | 38.53629 | 91 | 0.658366 |
import copy
import numpy
import pytest
import scipy
from scipy import sparse as sps
import scipy.sparse.linalg
from projectq import MainEngine
from projectq.backends import Simulator
from projectq.cengines import (DummyEngine, AutoReplacer, InstructionFilter,
InstructionF... | true | true |
1c2654388248c3a8caf1d863a7be62d03cc33b2e | 1,429 | py | Python | odp/lib/schema.py | SAEON/Open-Data-Platform | 8509c39c6f65ba18518e825e2359213ec4c67af5 | [
"MIT"
] | null | null | null | odp/lib/schema.py | SAEON/Open-Data-Platform | 8509c39c6f65ba18518e825e2359213ec4c67af5 | [
"MIT"
] | null | null | null | odp/lib/schema.py | SAEON/Open-Data-Platform | 8509c39c6f65ba18518e825e2359213ec4c67af5 | [
"MIT"
] | null | null | null | import hashlib
import re
from datetime import datetime
from pathlib import Path
from urllib.parse import urlparse
from jschon import LocalSource, URI, create_catalog
from jschon.translation import translation_filter
schema_catalog = create_catalog('2020-12', 'translation')
schema_catalog.add_uri_source(
URI('http... | 32.477273 | 84 | 0.705388 | import hashlib
import re
from datetime import datetime
from pathlib import Path
from urllib.parse import urlparse
from jschon import LocalSource, URI, create_catalog
from jschon.translation import translation_filter
schema_catalog = create_catalog('2020-12', 'translation')
schema_catalog.add_uri_source(
URI('http... | true | true |
1c26550533e11d2c85efe4cefd20afe5b70238d6 | 6,860 | py | Python | src/fklearn/training/ensemble.py | vitorsrg/fklearn | 4c6323bf78983164351e977891287f883b4b20d7 | [
"Apache-2.0"
] | 1,505 | 2019-04-22T14:25:00.000Z | 2022-03-29T20:12:18.000Z | src/fklearn/training/ensemble.py | vitorsrg/fklearn | 4c6323bf78983164351e977891287f883b4b20d7 | [
"Apache-2.0"
] | 125 | 2019-04-22T19:18:59.000Z | 2022-03-30T12:06:32.000Z | src/fklearn/training/ensemble.py | vitorsrg/fklearn | 4c6323bf78983164351e977891287f883b4b20d7 | [
"Apache-2.0"
] | 205 | 2019-04-23T13:54:19.000Z | 2022-02-19T18:30:08.000Z | from typing import Any, Dict, List, TypeVar
import pandas as pd
from toolz import curry, assoc, compose
from fklearn.training.classification import xgb_classification_learner
from fklearn.common_docstrings import learner_pred_fn_docstring, learner_return_docstring
from fklearn.types import LearnerReturnType
from fkle... | 41.829268 | 120 | 0.565598 | from typing import Any, Dict, List, TypeVar
import pandas as pd
from toolz import curry, assoc, compose
from fklearn.training.classification import xgb_classification_learner
from fklearn.common_docstrings import learner_pred_fn_docstring, learner_return_docstring
from fklearn.types import LearnerReturnType
from fkle... | true | true |
1c26558a3c8ce920911fc705a4a2fed78b55f036 | 267 | py | Python | nagoyalookupservice/nagoya_rest/routers.py | hseifert/nagoya-lookup-service | 2978d3a162c134ce32e516c701c13df5176109f7 | [
"MIT"
] | 1 | 2020-03-23T09:15:35.000Z | 2020-03-23T09:15:35.000Z | nagoyalookupservice/nagoya_rest/routers.py | hseifert/nagoya-lookup-service | 2978d3a162c134ce32e516c701c13df5176109f7 | [
"MIT"
] | 5 | 2020-06-06T00:31:58.000Z | 2021-09-08T01:37:42.000Z | nagoyalookupservice/nagoya_rest/routers.py | hseifert/nagoya-lookup-service | 2978d3a162c134ce32e516c701c13df5176109f7 | [
"MIT"
] | null | null | null | # used for module loading
class NagoyaRouter:
def db_for_read(self, model, **hints):
"""
Attempts to read nagoya models from nagoyadb.
"""
if model._meta.app_label == 'nagoya':
return 'nagoya'
return 'default'
| 24.272727 | 53 | 0.580524 |
class NagoyaRouter:
def db_for_read(self, model, **hints):
if model._meta.app_label == 'nagoya':
return 'nagoya'
return 'default'
| true | true |
1c2657241bc0ed41bee019dea2815fccf459357b | 4,753 | py | Python | gamestonk_terminal/stocks/dark_pool_shorts/quandl_view.py | minhhoang1023/GamestonkTerminal | 195dc19b491052df080178c0cc6a9d535a91a704 | [
"MIT"
] | null | null | null | gamestonk_terminal/stocks/dark_pool_shorts/quandl_view.py | minhhoang1023/GamestonkTerminal | 195dc19b491052df080178c0cc6a9d535a91a704 | [
"MIT"
] | null | null | null | gamestonk_terminal/stocks/dark_pool_shorts/quandl_view.py | minhhoang1023/GamestonkTerminal | 195dc19b491052df080178c0cc6a9d535a91a704 | [
"MIT"
] | null | null | null | """ Quandl View """
__docformat__ = "numpy"
import logging
import os
from typing import List, Optional
import matplotlib.ticker
import pandas as pd
from matplotlib import pyplot as plt
from gamestonk_terminal.config_terminal import theme
from gamestonk_terminal.decorators import log_start_end
from gamestonk_terminal... | 30.082278 | 87 | 0.665474 | __docformat__ = "numpy"
import logging
import os
from typing import List, Optional
import matplotlib.ticker
import pandas as pd
from matplotlib import pyplot as plt
from gamestonk_terminal.config_terminal import theme
from gamestonk_terminal.decorators import log_start_end
from gamestonk_terminal.config_plot import ... | true | true |
1c26578c146416d75e53d339931acf2ef61f292e | 313 | py | Python | examples/miniapps/commands-and-handlers/application/handler.py | YelloFam/python-dependency-injector | 541131e33858ee1b8b5a7590d2bb9f929740ea1e | [
"BSD-3-Clause"
] | null | null | null | examples/miniapps/commands-and-handlers/application/handler.py | YelloFam/python-dependency-injector | 541131e33858ee1b8b5a7590d2bb9f929740ea1e | [
"BSD-3-Clause"
] | null | null | null | examples/miniapps/commands-and-handlers/application/handler.py | YelloFam/python-dependency-injector | 541131e33858ee1b8b5a7590d2bb9f929740ea1e | [
"BSD-3-Clause"
] | null | null | null | """Handlers module."""
from .repositories import RatingRepository
class CommandHandler:
def __init__(self, rating_repo: RatingRepository):
self.rating_repo = rating_repo
def save_rating(self):
print("Saving rating")
def something_else(self):
print("Doing something else")
| 20.866667 | 54 | 0.696486 |
from .repositories import RatingRepository
class CommandHandler:
def __init__(self, rating_repo: RatingRepository):
self.rating_repo = rating_repo
def save_rating(self):
print("Saving rating")
def something_else(self):
print("Doing something else")
| true | true |
1c2657e73a97711b6a3dc47856be7cb167687fec | 14,666 | py | Python | example/run_airl.py | AswinRetnakumar/Machina | 6519935ca4553192ac99fc1c7c1e7cab9dd72693 | [
"MIT"
] | null | null | null | example/run_airl.py | AswinRetnakumar/Machina | 6519935ca4553192ac99fc1c7c1e7cab9dd72693 | [
"MIT"
] | null | null | null | example/run_airl.py | AswinRetnakumar/Machina | 6519935ca4553192ac99fc1c7c1e7cab9dd72693 | [
"MIT"
] | null | null | null | """
An example of Adversarial Inverse Reinforcement Learning.
"""
import argparse
import copy
import json
import os
from pprint import pprint
import pickle
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import gym
import machina as mc
from machina.pols import GaussianPol, Categ... | 44.042042 | 129 | 0.63187 |
import argparse
import copy
import json
import os
from pprint import pprint
import pickle
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import gym
import machina as mc
from machina.pols import GaussianPol, CategoricalPol, MultiCategoricalPol
from machina.algos import airl, beh... | true | true |
1c2658a135914ee5bfeeea7f62b0dedb7ec2664c | 2,028 | py | Python | setup.py | Taier-Linux/SSH | 86ee496e685df5269e04c88678990a1a84b669de | [
"BSD-3-Clause"
] | 3 | 2021-01-07T12:58:29.000Z | 2021-03-19T07:31:36.000Z | setup.py | Taier-Linux/SSH | 86ee496e685df5269e04c88678990a1a84b669de | [
"BSD-3-Clause"
] | 1 | 2021-08-24T02:46:39.000Z | 2021-08-24T02:46:39.000Z | setup.py | Taier-Linux/SSH | 86ee496e685df5269e04c88678990a1a84b669de | [
"BSD-3-Clause"
] | 2 | 2021-04-04T09:35:14.000Z | 2021-04-04T09:38:15.000Z | #!/usr/bin/env python
from setuptools import setup
setup(
name="Cowrie",
description="Cowrie SSH/Telnet Honeypot.",
long_description="Cowrie SSH/Telnet Honeypot.",
author="Michel Oosterhof",
author_email="michel@oosterhof.net",
maintainer="Michel Oosterhof",
maintainer_email="michel@ooster... | 28.56338 | 77 | 0.544872 |
from setuptools import setup
setup(
name="Cowrie",
description="Cowrie SSH/Telnet Honeypot.",
long_description="Cowrie SSH/Telnet Honeypot.",
author="Michel Oosterhof",
author_email="michel@oosterhof.net",
maintainer="Michel Oosterhof",
maintainer_email="michel@oosterhof.net",
keyword... | true | true |
1c2658a8ac0cd6f5e936f02c940cbcef773ca17a | 56 | py | Python | datetime/__init__.py | coolmacmaniac/pyutils | f5e4089d05159407d21de6d589c535e581dc94cc | [
"MIT"
] | null | null | null | datetime/__init__.py | coolmacmaniac/pyutils | f5e4089d05159407d21de6d589c535e581dc94cc | [
"MIT"
] | null | null | null | datetime/__init__.py | coolmacmaniac/pyutils | f5e4089d05159407d21de6d589c535e581dc94cc | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from .DateTime import DateTime
| 14 | 30 | 0.642857 |
from .DateTime import DateTime
| true | true |
1c2658f202d16cf4061c2fa2dbd1cef4b07bd62e | 1,014 | py | Python | migrations/tests/test_0023_remove_meeting_enable_chat.py | MJJojo97/openslides-backend | af0d1edb0070e352d46f285a1ba0bbe3702d49ae | [
"MIT"
] | null | null | null | migrations/tests/test_0023_remove_meeting_enable_chat.py | MJJojo97/openslides-backend | af0d1edb0070e352d46f285a1ba0bbe3702d49ae | [
"MIT"
] | null | null | null | migrations/tests/test_0023_remove_meeting_enable_chat.py | MJJojo97/openslides-backend | af0d1edb0070e352d46f285a1ba0bbe3702d49ae | [
"MIT"
] | null | null | null | def test_migration(write, finalize, assert_model):
write(
{
"type": "create",
"fqid": "meeting/1",
"fields": {"a": 1, "enable_chat": False},
}
)
write(
{
"type": "update",
"fqid": "meeting/1",
"fields": {"a": 2, ... | 24.731707 | 60 | 0.477318 | def test_migration(write, finalize, assert_model):
write(
{
"type": "create",
"fqid": "meeting/1",
"fields": {"a": 1, "enable_chat": False},
}
)
write(
{
"type": "update",
"fqid": "meeting/1",
"fields": {"a": 2, ... | true | true |
1c26595e212bdc2017fcf83e1eb2efd4f8dbbbb9 | 891 | py | Python | crypto/rsa.py | Djaler/PyMail | 5b7bbf47689540a3ab5ad3c8ba331a8b64c1fe19 | [
"MIT"
] | null | null | null | crypto/rsa.py | Djaler/PyMail | 5b7bbf47689540a3ab5ad3c8ba331a8b64c1fe19 | [
"MIT"
] | null | null | null | crypto/rsa.py | Djaler/PyMail | 5b7bbf47689540a3ab5ad3c8ba331a8b64c1fe19 | [
"MIT"
] | null | null | null | import rsa
def generate_keys():
public_key, private_key = rsa.newkeys(512)
return public_key.save_pkcs1(), private_key.save_pkcs1()
def encrypt(data, public_key):
public_key = rsa.PublicKey.load_pkcs1(public_key)
return rsa.encrypt(data, public_key)
def decrypt(data, private_key):
private_key... | 22.846154 | 60 | 0.718294 | import rsa
def generate_keys():
public_key, private_key = rsa.newkeys(512)
return public_key.save_pkcs1(), private_key.save_pkcs1()
def encrypt(data, public_key):
public_key = rsa.PublicKey.load_pkcs1(public_key)
return rsa.encrypt(data, public_key)
def decrypt(data, private_key):
private_key... | true | true |
1c2659a667de34d221126ac01778859eea3809c4 | 38,982 | py | Python | tests/composition/test_interfaces.py | MetaCell/PsyNeuLink | aeddf3e8ea62504a5d928b100b59aa18e593156c | [
"Apache-2.0"
] | 67 | 2018-01-05T22:18:44.000Z | 2022-03-27T11:27:31.000Z | tests/composition/test_interfaces.py | MetaCell/PsyNeuLink | aeddf3e8ea62504a5d928b100b59aa18e593156c | [
"Apache-2.0"
] | 1,064 | 2017-12-01T18:58:27.000Z | 2022-03-31T22:22:24.000Z | tests/composition/test_interfaces.py | MetaCell/PsyNeuLink | aeddf3e8ea62504a5d928b100b59aa18e593156c | [
"Apache-2.0"
] | 25 | 2017-12-01T20:27:07.000Z | 2022-03-08T21:49:39.000Z | import numpy as np
import pytest
import psyneulink.core.llvm as pnlvm
from psyneulink.core.components.functions.nonstateful.transferfunctions import Identity, Linear
from psyneulink.core.components.mechanisms.processing.compositioninterfacemechanism import CompositionInterfaceMechanism
from psyneulink.core.components... | 38.672619 | 126 | 0.57701 | import numpy as np
import pytest
import psyneulink.core.llvm as pnlvm
from psyneulink.core.components.functions.nonstateful.transferfunctions import Identity, Linear
from psyneulink.core.components.mechanisms.processing.compositioninterfacemechanism import CompositionInterfaceMechanism
from psyneulink.core.components... | true | true |
1c265db18990a8ec49d95bcc0bba2cabf0fa5375 | 1,744 | py | Python | misc/script/civ_midspan_deflection.py | macarl08/esc180_coursework | 16f2adda1f35875b91020e72cb4180d2e45690ce | [
"MIT"
] | null | null | null | misc/script/civ_midspan_deflection.py | macarl08/esc180_coursework | 16f2adda1f35875b91020e72cb4180d2e45690ce | [
"MIT"
] | null | null | null | misc/script/civ_midspan_deflection.py | macarl08/esc180_coursework | 16f2adda1f35875b91020e72cb4180d2e45690ce | [
"MIT"
] | null | null | null | # civ_midspan_deflection.py
# CIV102 Bridge Project
# Fall 2021
# Group 403
# Group Members:
# - Carl Ma
# - Abdullah Fawzy
# - Albert Zhang
# ------------------------------ IMPORT MODULES ------------------------------ #
import math
import numpy as np
# ------------------------------ CONSTANTS: Material Proper... | 22.649351 | 94 | 0.646216 |
import math
import numpy as np
DIM = [813,1016,1.27]
T_STRENGTH = 30
C_STRENGTH = 6
SHEAR_STRENGTH = 4
YOUNG = 4000
POISSON = 0.2
CEMENT_SHEAR = 2
LENGTH = 1250
def bmd_to_curvature(bmd, E, I):
x_cord, y_cord = zip(*bmd)
x_cord_curvature = list(x_cord)
y_cord_curvature = list(y_cord)
for i in r... | true | true |
1c265e873b681838fb655e9df321e804f0a4574e | 13,583 | py | Python | src/azure-cli/azure/cli/command_modules/keyvault/commands.py | digimaun/azure-cli | 298994660f0fde6863cb45a7c3142141ed10f923 | [
"MIT"
] | 1 | 2020-12-12T02:53:24.000Z | 2020-12-12T02:53:24.000Z | src/azure-cli/azure/cli/command_modules/keyvault/commands.py | digimaun/azure-cli | 298994660f0fde6863cb45a7c3142141ed10f923 | [
"MIT"
] | 1 | 2021-06-02T04:24:22.000Z | 2021-06-02T04:24:22.000Z | src/azure-cli/azure/cli/command_modules/keyvault/commands.py | digimaun/azure-cli | 298994660f0fde6863cb45a7c3142141ed10f923 | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 60.638393 | 119 | 0.690716 |
from azure.cli.core.commands import CliCommandType
from azure.cli.core.profiles import get_api_version, ResourceType
from ._client_factory import (
keyvault_client_vaults_factory, keyvault_client_private_endpoint_connections_factory,
keyvault_client_private_link_resources_factory, keyvault_data_plane_fac... | true | true |
1c2660cdf13f159f1698cf9260a367bf4ec8ea58 | 39,699 | py | Python | qa/rpc-tests/segwit.py | gotaproblem/mincoin | b58fd07866c8cffe68c0be2eafe8e043e47bde7d | [
"MIT"
] | 14 | 2016-12-19T07:30:25.000Z | 2021-04-16T06:40:15.000Z | qa/rpc-tests/segwit.py | gotaproblem/mincoin | b58fd07866c8cffe68c0be2eafe8e043e47bde7d | [
"MIT"
] | 1 | 2018-09-16T17:14:49.000Z | 2018-09-16T17:14:49.000Z | qa/rpc-tests/segwit.py | gotaproblem/mincoin | b58fd07866c8cffe68c0be2eafe8e043e47bde7d | [
"MIT"
] | 13 | 2017-04-13T08:55:04.000Z | 2022-02-28T05:12:48.000Z | #!/usr/bin/env python3
# Copyright (c) 2016 The Bitcoin Core developers
# Copyright (c) 2016-2019 The Mincoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test the SegWit changeover logic
#
from test_framew... | 60.059002 | 213 | 0.687801 |
from test_framework.test_framework import MincoinTestFramework
from test_framework.util import *
from test_framework.mininode import sha256, ripemd160, CTransaction, CTxIn, COutPoint, CTxOut
from test_framework.address import script_to_p2sh, key_to_p2pkh
from test_framework.script import CScript, OP_HASH160, ... | true | true |
1c2661b5c791ce6d303b6449897a702e4d0f4b8f | 1,533 | py | Python | neutron/plugins/ml2/drivers/huawei/config.py | JackyGao2016/OpenStack-ML2 | fc0569e72c7cfdbf9464c95572b242bfdd4cd79c | [
"Apache-2.0"
] | 1 | 2021-02-19T05:54:04.000Z | 2021-02-19T05:54:04.000Z | neutron/plugins/ml2/drivers/huawei/config.py | JackyGao2016/OpenStack-ML2 | fc0569e72c7cfdbf9464c95572b242bfdd4cd79c | [
"Apache-2.0"
] | null | null | null | neutron/plugins/ml2/drivers/huawei/config.py | JackyGao2016/OpenStack-ML2 | fc0569e72c7cfdbf9464c95572b242bfdd4cd79c | [
"Apache-2.0"
] | 2 | 2016-11-29T11:22:58.000Z | 2016-11-29T11:54:41.000Z | # Copyright (c) 2013 OpenStack Foundation
#
# 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 ... | 34.066667 | 69 | 0.634051 |
from oslo.config import cfg
HUAWEI_DRIVER_OPTS = [
cfg.StrOpt('username',
default='',
help=_('Username for communications to Huawei Switch.'
'This is required field.')),
cfg.StrOpt('password',
default='',
secret=... | true | true |
1c2661d3282997a3c1824816e6f5d353c151b1af | 91,120 | py | Python | src/pdbatoms.py | nurmians/ASA_UTA | 414d0b7588f3600273220741ca793ea4ed6b1734 | [
"MIT"
] | 1 | 2019-09-01T04:55:01.000Z | 2019-09-01T04:55:01.000Z | src/asa/pdbatoms.py | nurmians/StructureMapper | a759cee2a49ea83d9932ef72f7d967dd60f723fb | [
"MIT"
] | null | null | null | src/asa/pdbatoms.py | nurmians/StructureMapper | a759cee2a49ea83d9932ef72f7d967dd60f723fb | [
"MIT"
] | null | null | null | #!/usr/bin/python
# coding=UTF-8
# -*- coding: UTF-8 -*-
# This file is part of the StructureMapper algorithm.
# Please cite the authors if you find this software useful
#
# https://academic.oup.com/bioinformatics/advance-article/doi/10.1093/bioinformatics/bty086/4857361
# MIT License
#
# Copyright 2018 Anssi Nurmin... | 39.929886 | 221 | 0.577118 |
import sys
import os
import operator
import re
import math
pdbatoms_version = "1.0b"
pdb_aas = ["ALA","ARG","ASN","ASP","CYS","GLN","GLU", "GLY",
"HIS","HSD","HSP","HSE","ILE","LEU","LYS", "MET",
"PHE","PRO","SER","THR","TRP","TYR","VAL"]
res_map = {"ALA":"A... | false | true |
1c26635874b1dc32f13b7dc134215d6c45116765 | 12,266 | py | Python | nuitka/nodes/OutlineNodes.py | byehack/Nuitka | 6d868e6d6c371f46ce627f8b774ad3db3d14cab3 | [
"Apache-2.0"
] | 1,228 | 2015-01-01T15:12:50.000Z | 2018-09-21T20:41:11.000Z | nuitka/nodes/OutlineNodes.py | lps1333/Nuitka | 02e8d59a275cd7fe482cbc8100e753ff5abe39d7 | [
"Apache-2.0"
] | 131 | 2015-09-13T05:43:05.000Z | 2018-09-22T08:34:41.000Z | nuitka/nodes/OutlineNodes.py | lps1333/Nuitka | 02e8d59a275cd7fe482cbc8100e753ff5abe39d7 | [
"Apache-2.0"
] | 92 | 2015-02-02T21:05:35.000Z | 2018-09-07T00:14:43.000Z | # Copyright 2021, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... | 33.422343 | 88 | 0.653025 |
from .ConstantRefNodes import makeConstantRefNode
from .ExceptionNodes import ExpressionRaiseException
from .ExpressionBases import ExpressionChildHavingBase
from .FunctionNodes import ExpressionFunctionBodyBase
from .LocalsScopes import getLocalsDictHandle
class ExpressionOutlineBody(ExpressionChil... | true | true |
1c26636852e8203acdcf39652d7daeeb4c91486b | 917 | py | Python | lol9k1/auth/forms/validators.py | hubwoop/lol9k1 | a33bd97fc0473d6700f608851c07c99c0bea15cb | [
"MIT"
] | 2 | 2018-11-12T20:45:49.000Z | 2018-12-13T18:01:39.000Z | lol9k1/auth/forms/validators.py | hubwoop/lol9k1 | a33bd97fc0473d6700f608851c07c99c0bea15cb | [
"MIT"
] | null | null | null | lol9k1/auth/forms/validators.py | hubwoop/lol9k1 | a33bd97fc0473d6700f608851c07c99c0bea15cb | [
"MIT"
] | 1 | 2018-12-13T18:02:36.000Z | 2018-12-13T18:02:36.000Z | import typing
from wtforms import ValidationError
from lol9k1 import database
class ValidToken(object):
""" A validator for tokens """
def __init__(self, message_invalid=None):
self.message_invalid = message_invalid if message_invalid else "Invalid or used invite token"
def __call__(self, form... | 29.580645 | 113 | 0.696838 | import typing
from wtforms import ValidationError
from lol9k1 import database
class ValidToken(object):
def __init__(self, message_invalid=None):
self.message_invalid = message_invalid if message_invalid else "Invalid or used invite token"
def __call__(self, form, field):
maybe_matched_tok... | true | true |
1c26636d1847775369436211067a5ee9751397a7 | 17,365 | py | Python | pyigra2/derived.py | patrjon/pyigra2 | 437ee3c17caa9393a3464aeac0559b6323382d3c | [
"MIT"
] | null | null | null | pyigra2/derived.py | patrjon/pyigra2 | 437ee3c17caa9393a3464aeac0559b6323382d3c | [
"MIT"
] | null | null | null | pyigra2/derived.py | patrjon/pyigra2 | 437ee3c17caa9393a3464aeac0559b6323382d3c | [
"MIT"
] | null | null | null | # STD-lib
# 3rd-party
import numpy as np
# Local
from pyigra2.base import IGRABase
class Derived(IGRABase):
def __init__(self, filename):
# Init parent class
super().__init__(filename)
# Set file specific headers and parameters
# OBS! These index values are exactly what was given... | 40.011521 | 119 | 0.503542 |
import numpy as np
from pyigra2.base import IGRABase
class Derived(IGRABase):
def __init__(self, filename):
super().__init__(filename)
self._header_name_index = {
"HEADREC": [1, 1],
"ID": [2, 12],
"YEAR": [14, 1... | true | true |
1c26637b59801dea15d7c33408538ae5242d5162 | 31,189 | py | Python | tests/system/feature_store/test_feature_store.py | adiso75/mlrun | 0da2e72a1e2aa189074bd2ec059f2bc452f349cf | [
"Apache-2.0"
] | null | null | null | tests/system/feature_store/test_feature_store.py | adiso75/mlrun | 0da2e72a1e2aa189074bd2ec059f2bc452f349cf | [
"Apache-2.0"
] | null | null | null | tests/system/feature_store/test_feature_store.py | adiso75/mlrun | 0da2e72a1e2aa189074bd2ec059f2bc452f349cf | [
"Apache-2.0"
] | null | null | null | import os
import random
import string
import uuid
from datetime import datetime
import fsspec
import pandas as pd
import pyarrow.parquet as pq
import pytest
from storey import EmitAfterMaxEvent, MapClass
import mlrun
import mlrun.feature_store as fs
from mlrun.data_types.data_types import ValueType
from mlrun.datasto... | 36.953791 | 90 | 0.593799 | import os
import random
import string
import uuid
from datetime import datetime
import fsspec
import pandas as pd
import pyarrow.parquet as pq
import pytest
from storey import EmitAfterMaxEvent, MapClass
import mlrun
import mlrun.feature_store as fs
from mlrun.data_types.data_types import ValueType
from mlrun.datasto... | true | true |
1c2663aa8bbe82761803d84fbb4b9ad5324c4bbe | 747 | py | Python | XE_NETCONF/XE_Interface_List.py | abhijitbakale/PCNE | cf5a7cf0b839d4f3565c2ddac866dc0b1e044f87 | [
"Apache-2.0"
] | 1 | 2021-05-26T18:21:20.000Z | 2021-05-26T18:21:20.000Z | XE_NETCONF/XE_Interface_List.py | abhijitbakale/PCNE | cf5a7cf0b839d4f3565c2ddac866dc0b1e044f87 | [
"Apache-2.0"
] | null | null | null | XE_NETCONF/XE_Interface_List.py | abhijitbakale/PCNE | cf5a7cf0b839d4f3565c2ddac866dc0b1e044f87 | [
"Apache-2.0"
] | 1 | 2021-06-11T07:39:31.000Z | 2021-06-11T07:39:31.000Z | from ncclient import manager
import xmltodict
import xml.dom.minidom
xe = {
'host': '192.168.240.164',
'port': '830',
'username': 'admin',
'password': 'cisco'
}
netconf_filter = """
<filter>
<interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
<interface>
... | 21.342857 | 77 | 0.567604 | from ncclient import manager
import xmltodict
import xml.dom.minidom
xe = {
'host': '192.168.240.164',
'port': '830',
'username': 'admin',
'password': 'cisco'
}
netconf_filter = """
<filter>
<interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
<interface>
... | false | true |
1c266494cdb54d90b78fddcedffecdf154726ab1 | 2,892 | py | Python | samples/basic/executor/models/cisco-ios-xr/Cisco-IOS-XR-snmp-test-trap-act/nc-execute-xr-snmp-test-trap-act-134-ydk.py | maccioni/ydk-py-samples | d1758694bef97327c5477e65649326c7595ce499 | [
"Apache-2.0"
] | 1 | 2021-07-08T14:02:12.000Z | 2021-07-08T14:02:12.000Z | samples/basic/executor/models/cisco-ios-xr/Cisco-IOS-XR-snmp-test-trap-act/nc-execute-xr-snmp-test-trap-act-134-ydk.py | maccioni/ydk-py-samples | d1758694bef97327c5477e65649326c7595ce499 | [
"Apache-2.0"
] | null | null | null | samples/basic/executor/models/cisco-ios-xr/Cisco-IOS-XR-snmp-test-trap-act/nc-execute-xr-snmp-test-trap-act-134-ydk.py | maccioni/ydk-py-samples | d1758694bef97327c5477e65649326c7595ce499 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2016 Cisco Systems, 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 applicab... | 34.843373 | 100 | 0.679806 |
from argparse import ArgumentParser
from urlparse import urlparse
from ydk.services import ExecutorService
from ydk.providers import NetconfServiceProvider
from ydk.models.cisco_ios_xr import Cisco_IOS_XR_snmp_test_trap_act \
as xr_snmp_test_trap_act
import logging
def prepare_platform_hfr_plan... | true | true |
1c266498fbbde9f3800c2d5fff31b99b6266c3fa | 709 | py | Python | ScikitLearn/featureSelection.py | AutuanLiu/Machine-Learning-on-docker | 00eb7211a3a40a9da02114923647dfd6ac24f138 | [
"Apache-2.0"
] | 11 | 2018-03-18T11:06:59.000Z | 2020-02-23T03:24:43.000Z | ScikitLearn/featureSelection.py | AutuanLiu/Machine-Learning-on-docker | 00eb7211a3a40a9da02114923647dfd6ac24f138 | [
"Apache-2.0"
] | null | null | null | ScikitLearn/featureSelection.py | AutuanLiu/Machine-Learning-on-docker | 00eb7211a3a40a9da02114923647dfd6ac24f138 | [
"Apache-2.0"
] | 4 | 2018-03-28T13:04:26.000Z | 2019-05-29T05:49:52.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name:featureSelection
Description : 特征选择
Email : autuanliu@163.com
Date:2017/12/26
"""
from sklearn.feature_selection import VarianceThreshold
X = [[0, 0, 1], [0, 1, 0], [1, 0, 0], [0, 1, 1], [0, 1, ... | 23.633333 | 70 | 0.638928 |
from sklearn.feature_selection import VarianceThreshold
X = [[0, 0, 1], [0, 1, 0], [1, 0, 0], [0, 1, 1], [0, 1, 0], [0, 1, 1]]
sel = VarianceThreshold(threshold=(.8 * (1 - .8)))
x_trans = sel.fit_transform(X)
print(x_trans)
from sklearn.datasets import load_iris
from sklearn.feature_selection import SelectKBe... | true | true |
1c2665bf09c5f9d607b856244999d126d498965b | 1,802 | py | Python | hypebot/hype_types.py | jellzilla/hypebot | d85158cf5d966d24c3c2ca5789530864c9fe2662 | [
"Apache-2.0"
] | 17 | 2018-04-06T18:15:38.000Z | 2021-05-20T13:44:15.000Z | hypebot/hype_types.py | jellzilla/hypebot | d85158cf5d966d24c3c2ca5789530864c9fe2662 | [
"Apache-2.0"
] | 8 | 2018-04-06T16:04:50.000Z | 2022-01-06T02:54:38.000Z | hypebot/hype_types.py | jellzilla/hypebot | d85158cf5d966d24c3c2ca5789530864c9fe2662 | [
"Apache-2.0"
] | 8 | 2018-04-06T00:28:37.000Z | 2021-10-15T11:29:44.000Z | # Copyright 2018 The Hypebot 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 applicable ... | 32.763636 | 79 | 0.756937 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from typing import Dict, List, Optional, Text, Union
from hypebot.protos import channel_pb2
from hypebot.protos import message_pb2
Message = message_pb2... | true | true |
1c26664b47cdb43b8cc7c9685f6597efb9128206 | 182 | py | Python | test/kmeans/__init__.py | spectre-team/spectre-divik | 8e5cec5bc0040eb01cf6621bfb0753886f58524b | [
"Apache-2.0"
] | null | null | null | test/kmeans/__init__.py | spectre-team/spectre-divik | 8e5cec5bc0040eb01cf6621bfb0753886f58524b | [
"Apache-2.0"
] | 2 | 2018-01-20T19:11:02.000Z | 2018-01-23T21:44:53.000Z | test/kmeans/__init__.py | spectre-team/spectre-divik | 8e5cec5bc0040eb01cf6621bfb0753886f58524b | [
"Apache-2.0"
] | null | null | null | import numpy as np
data = np.array([
[1, 1, 1, 1],
[2, 4, 2, 2],
[1.9, 4.2, 1.9, 1.9],
[2, 2, 2, 2],
[1.1, 0.8, 1.1, 1.1],
[1000, 490231, -412342, -7012]
])
| 16.545455 | 34 | 0.406593 | import numpy as np
data = np.array([
[1, 1, 1, 1],
[2, 4, 2, 2],
[1.9, 4.2, 1.9, 1.9],
[2, 2, 2, 2],
[1.1, 0.8, 1.1, 1.1],
[1000, 490231, -412342, -7012]
])
| true | true |
1c26668dcd35d0b5e6549488a8730d64c5125407 | 11,157 | py | Python | test/tool_shed/functional/test_0430_browse_utilities.py | vimalkumarvelayudhan/galaxy | ea89dd8f149778b6c2f0f3f4a34c8b21f7033af7 | [
"CC-BY-3.0"
] | null | null | null | test/tool_shed/functional/test_0430_browse_utilities.py | vimalkumarvelayudhan/galaxy | ea89dd8f149778b6c2f0f3f4a34c8b21f7033af7 | [
"CC-BY-3.0"
] | null | null | null | test/tool_shed/functional/test_0430_browse_utilities.py | vimalkumarvelayudhan/galaxy | ea89dd8f149778b6c2f0f3f4a34c8b21f7033af7 | [
"CC-BY-3.0"
] | null | null | null | from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os
import logging
log = logging.getLogger( __name__ )
datatypes_repository_name = 'emboss_datatypes_0430'
datatypes_repository_description = 'Galaxy applicable datatypes for EMBOSS for test 0430'
datatypes_repository_long_description = 'Long descri... | 61.302198 | 160 | 0.653133 | from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os
import logging
log = logging.getLogger( __name__ )
datatypes_repository_name = 'emboss_datatypes_0430'
datatypes_repository_description = 'Galaxy applicable datatypes for EMBOSS for test 0430'
datatypes_repository_long_description = 'Long descri... | true | true |
1c2666a833a555017b45b7a5535e16103087b9f3 | 1,164 | py | Python | lvluppy/models/Payment.py | kazigk/LvlUpPy | 6cf7203c9c983fc241297e84bb5e273dc3a0092b | [
"MIT"
] | 4 | 2020-05-03T22:36:24.000Z | 2020-05-10T13:58:51.000Z | lvluppy/models/Payment.py | kazigk/LvlUpPy | 6cf7203c9c983fc241297e84bb5e273dc3a0092b | [
"MIT"
] | null | null | null | lvluppy/models/Payment.py | kazigk/LvlUpPy | 6cf7203c9c983fc241297e84bb5e273dc3a0092b | [
"MIT"
] | null | null | null | from .BaseModel import BaseModel
from .ServiceType import ServiceType
from enum import Enum
class Payment(BaseModel):
def __init__(
self,
amount,
createdAt,
description,
id,
methodId,
serviceId
):
self.__amount = float(amount)
self.__createdAt = self._parseDateTime(createdAt)
... | 17.907692 | 53 | 0.656357 | from .BaseModel import BaseModel
from .ServiceType import ServiceType
from enum import Enum
class Payment(BaseModel):
def __init__(
self,
amount,
createdAt,
description,
id,
methodId,
serviceId
):
self.__amount = float(amount)
self.__createdAt = self._parseDateTime(createdAt)
... | true | true |
1c2667fe42fb3a96da78b2c00fdda08ea189e420 | 4,315 | py | Python | lite/tests/unittest_py/op/test_compare_less_op.py | 714627034/Paddle-Lite | 015ba88a4d639db0b73603e37f83e47be041a4eb | [
"Apache-2.0"
] | 808 | 2018-04-17T17:43:12.000Z | 2019-08-18T07:39:13.000Z | lite/tests/unittest_py/op/test_compare_less_op.py | 714627034/Paddle-Lite | 015ba88a4d639db0b73603e37f83e47be041a4eb | [
"Apache-2.0"
] | 728 | 2018-04-18T08:15:25.000Z | 2019-08-16T07:14:43.000Z | lite/tests/unittest_py/op/test_compare_less_op.py | 714627034/Paddle-Lite | 015ba88a4d639db0b73603e37f83e47be041a4eb | [
"Apache-2.0"
] | 364 | 2018-04-18T17:05:02.000Z | 2019-08-18T03:25:38.000Z | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 36.260504 | 125 | 0.614368 |
import sys
from numpy.lib.function_base import place
sys.path.append('../')
from auto_scan_test import AutoScanTest, IgnoreReasons
from program_config import TensorConfig, ProgramConfig, OpConfig, CxxConfig, TargetType, PrecisionType, DataLayoutType, Place
import unittest
import hypothesis
from hypothe... | true | true |
1c26693d5bdd59e68105d66beb1bc730dce5ba0e | 50,301 | py | Python | hazelcast/config.py | yuce/hazelcast-python-client | 9e993fd81223ca2ddf3b055397c4e7178f273674 | [
"Apache-2.0"
] | null | null | null | hazelcast/config.py | yuce/hazelcast-python-client | 9e993fd81223ca2ddf3b055397c4e7178f273674 | [
"Apache-2.0"
] | null | null | null | hazelcast/config.py | yuce/hazelcast-python-client | 9e993fd81223ca2ddf3b055397c4e7178f273674 | [
"Apache-2.0"
] | null | null | null | import re
import types
from hazelcast import six
from hazelcast.errors import InvalidConfigurationError
from hazelcast.serialization.api import StreamSerializer, IdentifiedDataSerializable, Portable
from hazelcast.serialization.portable.classdef import ClassDefinition
from hazelcast.security import TokenProvider
from ... | 31.896639 | 110 | 0.634918 | import re
import types
from hazelcast import six
from hazelcast.errors import InvalidConfigurationError
from hazelcast.serialization.api import StreamSerializer, IdentifiedDataSerializable, Portable
from hazelcast.serialization.portable.classdef import ClassDefinition
from hazelcast.security import TokenProvider
from ... | true | true |
1c266993fc595f1d23359dfe51ffbfa658855e92 | 10,255 | py | Python | examples/axelrod_aurora_test1.py | cash/dworp | b7b0280183d4fa54b65bf5a3d4008bf64b7434dc | [
"BSD-3-Clause"
] | null | null | null | examples/axelrod_aurora_test1.py | cash/dworp | b7b0280183d4fa54b65bf5a3d4008bf64b7434dc | [
"BSD-3-Clause"
] | null | null | null | examples/axelrod_aurora_test1.py | cash/dworp | b7b0280183d4fa54b65bf5a3d4008bf64b7434dc | [
"BSD-3-Clause"
] | null | null | null | __author__ = 'schmiac1'
"""
Aurora's Attempt to quickly implement Axelrod model of...
The Dissemination of Culture: A Model with Local Convergence and Global Polarization
Robert Axelrod
Journal of Conflict Resolution
Vol 41, Issue 2, pp. 203 - 226
April 1, 1997
http://journals.sagepub.com/doi/10.1177/0022002797041002... | 43.45339 | 208 | 0.610336 | __author__ = 'schmiac1'
import dworp
import igraph
import logging
import numpy as np
import pdb
class Site(dworp.Agent):
, numtraitsper=10):
super().__init__(vertex.index, numfeatures)
vertex['agent'] = self
self.vertex = vertex
self.numtraits = numtraitsper
def init(self, s... | true | true |
1c266ad1fcc2c937e78b7bd6e03afc0f891f9b2c | 5,002 | py | Python | plot_functions/mem_plot_heatmap.py | arled-papa/marc | cb94636d786e215195e914b37131277f835bcf52 | [
"Apache-2.0"
] | 1 | 2021-11-30T00:07:28.000Z | 2021-11-30T00:07:28.000Z | plot_functions/mem_plot_heatmap.py | arled-papa/marc | cb94636d786e215195e914b37131277f835bcf52 | [
"Apache-2.0"
] | null | null | null | plot_functions/mem_plot_heatmap.py | arled-papa/marc | cb94636d786e215195e914b37131277f835bcf52 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright (c) 2021 Arled Papa
# Author: Arled Papa <arled.papa@tum.de>
#
# 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... | 33.797297 | 121 | 0.682327 |
import numpy as np
import matplotlib.pyplot as plt
import math
controller = "flexran"
input_folder = "data/{}_measurements".format(controller)
output_folder = "output_plots/"
measurement = "Memory"
def set_box_color(bp, color):
print(color)
for box in bp['boxes']:
box... | true | true |
1c266ad4ec526381264268c21aac7532b12408aa | 97 | py | Python | homeassistant/components/noaa_tides_and_currents/const.py | karliemeads/core | 886eeabb58a3cae3c5b00e5a3b77faa869e6053b | [
"Apache-2.0"
] | null | null | null | homeassistant/components/noaa_tides_and_currents/const.py | karliemeads/core | 886eeabb58a3cae3c5b00e5a3b77faa869e6053b | [
"Apache-2.0"
] | null | null | null | homeassistant/components/noaa_tides_and_currents/const.py | karliemeads/core | 886eeabb58a3cae3c5b00e5a3b77faa869e6053b | [
"Apache-2.0"
] | null | null | null | """Constants for the NOAA Tides and Currents integration."""
DOMAIN = "noaa_tides_and_currents"
| 24.25 | 60 | 0.773196 |
DOMAIN = "noaa_tides_and_currents"
| true | true |
1c266c3dac2accd4d539c40e0c5b85080c94e1f1 | 8,177 | py | Python | unified_planning/shortcuts.py | aiplan4eu/unified-planning | d2fd18baa3a2110595e5dfdc3f55254df72c3016 | [
"Apache-2.0"
] | 9 | 2022-02-18T14:51:58.000Z | 2022-03-31T06:02:43.000Z | unified_planning/shortcuts.py | aiplan4eu/unified-planning | d2fd18baa3a2110595e5dfdc3f55254df72c3016 | [
"Apache-2.0"
] | 37 | 2022-02-01T10:44:38.000Z | 2022-03-31T09:13:42.000Z | unified_planning/shortcuts.py | aiplan4eu/unified-planning | d2fd18baa3a2110595e5dfdc3f55254df72c3016 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 AIPlan4EU project
#
# 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 wri... | 45.938202 | 120 | 0.697077 |
import sys
import unified_planning as up
import unified_planning.model.types
from unified_planning.environment import get_env
from unified_planning.model import *
from unified_planning.engines import Engine, CompilationKind
from typing import IO, Iterable, List, Union, Dict, Tuple, Optional
from fraction... | true | true |
1c266c8a56e709cfee03cf106b8c08b4b0087103 | 21,666 | py | Python | tests/copp/test_copp.py | avinish-marvell/sonic-mgmt | 42d4503f2e041e91be68c3c80b43e0e3f04b46ad | [
"Apache-2.0"
] | null | null | null | tests/copp/test_copp.py | avinish-marvell/sonic-mgmt | 42d4503f2e041e91be68c3c80b43e0e3f04b46ad | [
"Apache-2.0"
] | null | null | null | tests/copp/test_copp.py | avinish-marvell/sonic-mgmt | 42d4503f2e041e91be68c3c80b43e0e3f04b46ad | [
"Apache-2.0"
] | null | null | null | """
Tests the COPP feature in SONiC.
Notes:
These test cases require that a special RPC syncd image is installed on the
DUT. You can either pre-install this image and run the test normally, or
specify the `--swap-syncd` flag from the command line to have the test fetch
the RPC i... | 45.902542 | 201 | 0.66819 |
import ipaddr
import logging
import pytest
import json
import random
from collections import namedtuple
from tests.copp import copp_utils
from tests.ptf_runner import ptf_runner
from tests.common import config_reload, constants
from tests.common.system_utils import docker
from tests.common.helpers.generators import g... | true | true |
1c266ca4619111e5a3d130a40ef5a8d95b25be6f | 10,740 | py | Python | tools/update-property-types.py | voxie-viewer/voxie | d2b5e6760519782e9ef2e51f5322a3baa0cb1198 | [
"MIT"
] | 4 | 2016-06-03T18:41:43.000Z | 2020-04-17T20:28:58.000Z | tools/update-property-types.py | voxie-viewer/voxie | d2b5e6760519782e9ef2e51f5322a3baa0cb1198 | [
"MIT"
] | null | null | null | tools/update-property-types.py | voxie-viewer/voxie | d2b5e6760519782e9ef2e51f5322a3baa0cb1198 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
#
# Copyright (c) 2014-2022 The Voxie Authors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy,... | 37.552448 | 297 | 0.638734 |
import sys
import os
import subprocess
import json
import io
import property_types
import codegen_utils
os.chdir(os.path.join(os.path.dirname(sys.argv[0]), '..'))
typeJsonFilename = 'pythonlib/voxie/PropertyTypes.json'
typeListFilename = 'src/Voxie/Node/Types.List.cpp'
typeListHeaderFilename =... | true | true |
1c266dcd1060fa2197ef9d648220c246f90415f9 | 2,557 | py | Python | test.py | VinulaUthsara/FYP-PrototypeV2 | e7b629c30c10e6042b8ff2bd68fd6c7df3d46d4b | [
"MIT"
] | 1 | 2021-02-01T17:10:14.000Z | 2021-02-01T17:10:14.000Z | test.py | VinulaUthsara/FYP-PrototypeV2 | e7b629c30c10e6042b8ff2bd68fd6c7df3d46d4b | [
"MIT"
] | 2 | 2021-08-25T14:59:11.000Z | 2022-02-09T23:44:01.000Z | test.py | VinulaUthsara/FYP-PrototypeV2 | e7b629c30c10e6042b8ff2bd68fd6c7df3d46d4b | [
"MIT"
] | 1 | 2020-11-03T01:09:03.000Z | 2020-11-03T01:09:03.000Z | # -*- coding: utf-8 -*-
# @Date : 2019-07-25
# @Author : Xinyu Gong (xy_gong@tamu.edu)
# @Link : None
# @Version : 0.0
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import cfg
import models
from functions import validate
from utils.utils import set... | 31.567901 | 105 | 0.715291 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import cfg
import models
from functions import validate
from utils.utils import set_log_dir, create_logger
from utils.inception_score import _init_inception
from utils.fid_score import create_inception_gr... | true | true |
1c26703f2498874be5b6aa829a2761e6c44b98d8 | 1,419 | py | Python | raylink/algorithms/demo/policy.py | bytedance/raylink | cd83a4377fede1ac645037df567010f2ddac5a69 | [
"Apache-2.0"
] | 17 | 2021-10-11T06:52:09.000Z | 2022-01-12T01:04:59.000Z | raylink/algorithms/demo/policy.py | bytedance/raylink | cd83a4377fede1ac645037df567010f2ddac5a69 | [
"Apache-2.0"
] | null | null | null | raylink/algorithms/demo/policy.py | bytedance/raylink | cd83a4377fede1ac645037df567010f2ddac5a69 | [
"Apache-2.0"
] | 2 | 2021-10-11T08:19:04.000Z | 2021-12-04T02:48:13.000Z | from .model import Model
import numpy as np
import time
def softmax(x):
r"""Compute softmax values for each sets of scores in $x$.
Args:
x (numpy.ndarray): Input vector to compute softmax
Returns:
numpy.ndarray: softmax(x)
"""
e_x = np.exp(x - np.max(x))
return e_x / e_x.sum(... | 22.171875 | 62 | 0.554616 | from .model import Model
import numpy as np
import time
def softmax(x):
e_x = np.exp(x - np.max(x))
return e_x / e_x.sum()
class Policy(object):
TYPE = 'policy'
def __init__(self, obs_n, act_n):
self.obs_n = obs_n
self.act_n = act_n
self.learn_step = 0
def setup(self):... | true | true |
1c26705b6f1077ecd4ff6c5a4d56ffb3c268c849 | 180 | py | Python | 002-permutation.py | tony19871128/python-100 | 75c835596ce264ad47aea15c23b2757ef92beacd | [
"Apache-2.0"
] | 39 | 2020-12-21T01:59:32.000Z | 2022-03-07T10:49:13.000Z | 002-permutation.py | code6levels/python-100 | 75c835596ce264ad47aea15c23b2757ef92beacd | [
"Apache-2.0"
] | 1 | 2020-03-29T08:55:59.000Z | 2020-03-29T08:55:59.000Z | 002-permutation.py | code6levels/python-100 | 75c835596ce264ad47aea15c23b2757ef92beacd | [
"Apache-2.0"
] | 27 | 2020-02-25T03:31:30.000Z | 2020-11-25T02:27:38.000Z | class Permutations(object):
def is_permutation(self, str1, str2):
if str1 is None or str2 is None:
return False
return sorted(str1) == sorted(str2) | 30 | 43 | 0.627778 | class Permutations(object):
def is_permutation(self, str1, str2):
if str1 is None or str2 is None:
return False
return sorted(str1) == sorted(str2) | true | true |
1c26718cbf06708617d188983c16bea6f87b0095 | 4,257 | py | Python | dynamicDNS.py | nremynse/Automation-Scripts | ccb92d7f05c492ac1edfb1911889beadc0869238 | [
"MIT"
] | null | null | null | dynamicDNS.py | nremynse/Automation-Scripts | ccb92d7f05c492ac1edfb1911889beadc0869238 | [
"MIT"
] | null | null | null | dynamicDNS.py | nremynse/Automation-Scripts | ccb92d7f05c492ac1edfb1911889beadc0869238 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Cloudflare API code - example"""
from __future__ import print_function
import os
import sys
import re
import json
import requests
import CloudFlare
sys.path.insert(0, os.path.abspath('..'))
def my_ip_address():
"""Cloudflare API code - example"""
# This list is adjustable - plus s... | 29.978873 | 90 | 0.611229 |
from __future__ import print_function
import os
import sys
import re
import json
import requests
import CloudFlare
sys.path.insert(0, os.path.abspath('..'))
def my_ip_address():
url = 'https://api.ipify.org'
try:
ip_address = requests.get(url).text
except:
exit('%s... | true | true |
1c26718ee602c389e69371577e354bb2c8d9faaa | 1,066 | py | Python | app/migrations/versions/8407987dd2d5_new_fields_in_user_speech_model.py | WilsonHChung/speech-assistant-analyzer | 8e12db593024402237cb2787c733390a565c0f8e | [
"MIT"
] | null | null | null | app/migrations/versions/8407987dd2d5_new_fields_in_user_speech_model.py | WilsonHChung/speech-assistant-analyzer | 8e12db593024402237cb2787c733390a565c0f8e | [
"MIT"
] | null | null | null | app/migrations/versions/8407987dd2d5_new_fields_in_user_speech_model.py | WilsonHChung/speech-assistant-analyzer | 8e12db593024402237cb2787c733390a565c0f8e | [
"MIT"
] | null | null | null | """new fields in user, speech model
Revision ID: 8407987dd2d5
Revises: 508d6eb55b49
Create Date: 2021-04-26 12:42:13.583578
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '8407987dd2d5'
down_revision = '508d6eb55b49'
branch_labels = None
depends_on = None
de... | 30.457143 | 86 | 0.695122 | from alembic import op
import sqlalchemy as sa
revision = '8407987dd2d5'
down_revision = '508d6eb55b49'
branch_labels = None
depends_on = None
def upgrade():
add_column('user', sa.Column('about_me', sa.String(length=140), nullable=True))
op.add_column('user', sa.Column('last_seen', sa.DateTime(), nullable=... | true | true |
1c2671ddbb049f6068a6ceb15834d985743db81f | 14,784 | py | Python | keystone/tests/unit/test_cli.py | whitepages/keystone | 7a0874f6f69852584061fa384f75dfb0d5f1c229 | [
"Apache-2.0"
] | null | null | null | keystone/tests/unit/test_cli.py | whitepages/keystone | 7a0874f6f69852584061fa384f75dfb0d5f1c229 | [
"Apache-2.0"
] | null | null | null | keystone/tests/unit/test_cli.py | whitepages/keystone | 7a0874f6f69852584061fa384f75dfb0d5f1c229 | [
"Apache-2.0"
] | 1 | 2021-03-21T11:38:30.000Z | 2021-03-21T11:38:30.000Z | # Copyright 2014 IBM Corp.
#
# 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, s... | 40.393443 | 79 | 0.620603 |
import os
import uuid
import fixtures
import mock
from oslo_config import cfg
from six.moves import range
from keystone.cmd import cli
from keystone.common import dependency
from keystone.common.sql import migration_helpers
from keystone.i18n import _
from keystone import resource
from keystone.tests im... | true | true |
1c2671fbae543fa25260b383fcaaaff961492171 | 3,800 | py | Python | tests/system/test_connection_ncs1001.py | kstaniek/condoor | 77c054b29d4e286c1d7aca2c74dff86b805e1fae | [
"Apache-2.0"
] | 7 | 2016-01-20T09:04:09.000Z | 2020-02-25T07:14:38.000Z | tests/system/test_connection_ncs1001.py | kstaniek/condoor | 77c054b29d4e286c1d7aca2c74dff86b805e1fae | [
"Apache-2.0"
] | 55 | 2015-12-16T14:50:59.000Z | 2018-04-23T15:27:15.000Z | tests/system/test_connection_ncs1001.py | kstaniek/condoor | 77c054b29d4e286c1d7aca2c74dff86b805e1fae | [
"Apache-2.0"
] | 19 | 2016-04-22T06:09:32.000Z | 2022-02-25T20:21:51.000Z | from tests.system.common import CondoorTestCase, StopTelnetSrv, StartTelnetSrv
from tests.dmock.dmock import NCS1001Handler
from tests.utils import remove_cache_file
import condoor
class TestNCS1001Connection(CondoorTestCase):
@StartTelnetSrv(NCS1001Handler, 10023)
def setUp(self):
CondoorTestCase.se... | 50.666667 | 108 | 0.656316 | from tests.system.common import CondoorTestCase, StopTelnetSrv, StartTelnetSrv
from tests.dmock.dmock import NCS1001Handler
from tests.utils import remove_cache_file
import condoor
class TestNCS1001Connection(CondoorTestCase):
@StartTelnetSrv(NCS1001Handler, 10023)
def setUp(self):
CondoorTestCase.se... | true | true |
1c2672c3fab11b0ac615c5cd7a6bb2c912735a84 | 13,072 | py | Python | src/sourcetools/astoid.py | mmiguel6288code/sourcetools | 5c7dbb3d24a7790a9e0a18a506c7b6b0846d30d0 | [
"MIT"
] | null | null | null | src/sourcetools/astoid.py | mmiguel6288code/sourcetools | 5c7dbb3d24a7790a9e0a18a506c7b6b0846d30d0 | [
"MIT"
] | null | null | null | src/sourcetools/astoid.py | mmiguel6288code/sourcetools | 5c7dbb3d24a7790a9e0a18a506c7b6b0846d30d0 | [
"MIT"
] | null | null | null | """ astoid is ast with more features
"""
from enum import Enum,auto
import ast, sys
def iterate_with_siblings(iterable):
"""
Yields triplets of an item with its adjacent siblings
First item's previous sibling is None
Last item's next sibling is None
"""
prev_sibling = None
curr_sibling = Non... | 47.191336 | 193 | 0.644813 | from enum import Enum,auto
import ast, sys
def iterate_with_siblings(iterable):
prev_sibling = None
curr_sibling = None
items = list(iterable)
for next_sibling in items:
if curr_sibling is not None:
yield (prev_sibling,curr_sibling,next_sibling)
prev_sibling = curr_sibling
... | true | true |
1c26738a4adfc606090b276f46efb990fed99650 | 699 | py | Python | proj02_02.py | coderken1236/savy | 8cc15df71aee4f849c772fa754415161ffe71fa4 | [
"MIT"
] | null | null | null | proj02_02.py | coderken1236/savy | 8cc15df71aee4f849c772fa754415161ffe71fa4 | [
"MIT"
] | null | null | null | proj02_02.py | coderken1236/savy | 8cc15df71aee4f849c772fa754415161ffe71fa4 | [
"MIT"
] | null | null | null | # Name:
# Date:
# proj02_02: Fibonaci Sequence
"""
Asks a user how many Fibonacci numbers to generate and generates them. The Fibonacci
sequence is a sequence of numbers where the next number in the sequence is the sum of the
previous two numbers in the sequence. The sequence looks like this:
1, 1, 2, 3, 5, 8, 13.... | 26.884615 | 90 | 0.719599 |
"""
Asks a user how many Fibonacci numbers to generate and generates them. The Fibonacci
sequence is a sequence of numbers where the next number in the sequence is the sum of the
previous two numbers in the sequence. The sequence looks like this:
1, 1, 2, 3, 5, 8, 13...
"""
counter = 0
Number = raw_input("How ... | false | true |
1c2673ba78f75f2851d7d7051196b833993c1913 | 48,878 | py | Python | wandb/sklearn/__init__.py | dylanturpin/client | fe84c4a3aed292c96912c5239e4cf1c9e4fec009 | [
"Apache-2.0"
] | null | null | null | wandb/sklearn/__init__.py | dylanturpin/client | fe84c4a3aed292c96912c5239e4cf1c9e4fec009 | [
"Apache-2.0"
] | null | null | null | wandb/sklearn/__init__.py | dylanturpin/client | fe84c4a3aed292c96912c5239e4cf1c9e4fec009 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import, division, print_function, unicode_literals
import wandb
import time
import itertools
import sklearn
import numpy as np
import scipy as sp
from wandb.sklearn.utils import *
from sklearn.base import clone
from joblib import Parallel, delayed
from sklearn import model_selection
from... | 43.178445 | 151 | 0.620484 | from __future__ import absolute_import, division, print_function, unicode_literals
import wandb
import time
import itertools
import sklearn
import numpy as np
import scipy as sp
from wandb.sklearn.utils import *
from sklearn.base import clone
from joblib import Parallel, delayed
from sklearn import model_selection
from... | true | true |
1c26741480eb212c638d782e13f5db6824cb151e | 20,615 | py | Python | tests/test_matrix44.py | c0deaddict/Pyrr | 809a1018f4481cd962bbadda4cf156e4cad671ae | [
"Unlicense"
] | 1 | 2019-01-13T13:00:40.000Z | 2019-01-13T13:00:40.000Z | tests/test_matrix44.py | c0deaddict/Pyrr | 809a1018f4481cd962bbadda4cf156e4cad671ae | [
"Unlicense"
] | null | null | null | tests/test_matrix44.py | c0deaddict/Pyrr | 809a1018f4481cd962bbadda4cf156e4cad671ae | [
"Unlicense"
] | null | null | null | try:
import unittest2 as unittest
except:
import unittest
import numpy as np
from pyrr import matrix44, quaternion, vector3
class test_matrix44(unittest.TestCase):
def test_import(self):
import pyrr
pyrr.matrix44
from pyrr import matrix44
def test_create_identity(self):
... | 41.985743 | 156 | 0.564783 | try:
import unittest2 as unittest
except:
import unittest
import numpy as np
from pyrr import matrix44, quaternion, vector3
class test_matrix44(unittest.TestCase):
def test_import(self):
import pyrr
pyrr.matrix44
from pyrr import matrix44
def test_create_identity(self):
... | true | true |
1c267462917f9d639f99665cf3f0fc204d4312c4 | 18,218 | py | Python | FeatureExtractionModule/src/datareader.py | matkovic/Wi-Mind | 86e1e3c365776665fc1c647bbf19294dffe60e55 | [
"0BSD"
] | 1 | 2021-08-14T13:49:51.000Z | 2021-08-14T13:49:51.000Z | FeatureExtractionModule/src/datareader.py | matkovic/Wi-Mind | 86e1e3c365776665fc1c647bbf19294dffe60e55 | [
"0BSD"
] | null | null | null | FeatureExtractionModule/src/datareader.py | matkovic/Wi-Mind | 86e1e3c365776665fc1c647bbf19294dffe60e55 | [
"0BSD"
] | 1 | 2020-08-18T08:39:58.000Z | 2020-08-18T08:39:58.000Z | import scipy
import re
import os
from datetime import datetime
import numpy as np
import pandas as pd
from _bisect import bisect
from itertools import groupby
class DataReader:
"""Provides functions to read raw data acquired during the cognitive load study
i.e. tasks information and wireless data)."""
de... | 31.683478 | 217 | 0.57306 | import scipy
import re
import os
from datetime import datetime
import numpy as np
import pandas as pd
from _bisect import bisect
from itertools import groupby
class DataReader:
def __init__(self, path, ident):
self.path = path
self.ident = ident
self.phase = None
self.time = None
... | true | true |
1c2674b060f195adc9a43b7f56b717ab906714c1 | 8,513 | py | Python | superset/sqllab/command.py | razzius/superset | 93f59e055e8312fb28687bc9fc22342b4be68d0e | [
"Apache-2.0"
] | 18,621 | 2017-06-19T09:57:44.000Z | 2021-01-05T06:28:21.000Z | superset/sqllab/command.py | changeiot/superset | 299b5dc64448d04abe6b35ee85fbd2b938c781bc | [
"Apache-2.0"
] | 9,043 | 2017-07-05T16:10:48.000Z | 2021-01-05T17:58:01.000Z | superset/sqllab/command.py | changeiot/superset | 299b5dc64448d04abe6b35ee85fbd2b938c781bc | [
"Apache-2.0"
] | 5,527 | 2017-07-06T01:39:43.000Z | 2021-01-05T06:01:11.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 39.050459 | 88 | 0.69341 |
from __future__ import annotations
import logging
from typing import Any, Dict, Optional, TYPE_CHECKING
from flask_babel import gettext as __
from superset.commands.base import BaseCommand
from superset.common.db_query_status import QueryStatus
from superset.dao.exceptions import DAOCreateFailedErro... | true | true |
1c2674fc811b29d53217d12b27e38e5b302f3f64 | 1,766 | py | Python | airflow/cli/commands/config_command.py | ChaseKnowlden/airflow | 6b71eac1997a7c0db3b8e3aed6b4e65d01871440 | [
"Apache-2.0"
] | 15,947 | 2019-01-05T13:51:02.000Z | 2022-03-31T23:33:16.000Z | airflow/cli/commands/config_command.py | ChaseKnowlden/airflow | 6b71eac1997a7c0db3b8e3aed6b4e65d01871440 | [
"Apache-2.0"
] | 14,603 | 2019-01-05T09:43:19.000Z | 2022-03-31T23:11:59.000Z | airflow/cli/commands/config_command.py | ChaseKnowlden/airflow | 6b71eac1997a7c0db3b8e3aed6b4e65d01871440 | [
"Apache-2.0"
] | 8,429 | 2019-01-05T19:45:47.000Z | 2022-03-31T22:13:01.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 36.791667 | 102 | 0.738958 |
import io
import pygments
from pygments.lexers.configs import IniLexer
from airflow.configuration import conf
from airflow.utils.cli import should_use_colors
from airflow.utils.code_utils import get_terminal_formatter
def show_config(args):
with io.StringIO() as output:
conf.write(output... | true | true |
1c2675b4908d19d8e5e273498fa65f9e9a3b2d12 | 8,606 | py | Python | lib/aff4_objects/reports.py | nahidupa/grr | 100a9d85ef2abb234e12e3ac2623caffb4116be7 | [
"Apache-2.0"
] | 1 | 2016-02-13T15:40:20.000Z | 2016-02-13T15:40:20.000Z | lib/aff4_objects/reports.py | nahidupa/grr | 100a9d85ef2abb234e12e3ac2623caffb4116be7 | [
"Apache-2.0"
] | 3 | 2020-09-11T12:54:50.000Z | 2020-09-11T12:55:01.000Z | lib/aff4_objects/reports.py | nahidupa/grr | 100a9d85ef2abb234e12e3ac2623caffb4116be7 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""Module containing a set of reports for management of GRR."""
import csv
import datetime
import StringIO
import time
import logging
from grr.lib import config_lib
from grr.lib import email_alerts
from grr.lib import export_utils
from grr.lib import rdfvalue
from grr.lib import registry
from g... | 32.97318 | 79 | 0.650012 |
import csv
import datetime
import StringIO
import time
import logging
from grr.lib import config_lib
from grr.lib import email_alerts
from grr.lib import export_utils
from grr.lib import rdfvalue
from grr.lib import registry
from grr.lib.aff4_objects import aff4_grr
from grr.lib.aff4_objects import network
class ... | true | true |
1c267689b4d895fcb9299b26f446b4d8f620b693 | 40,884 | py | Python | pandas/core/indexes/interval.py | jle3/pandas | c322b2436cdbb447a430bb9eb1aff965d07e7e4e | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/core/indexes/interval.py | jle3/pandas | c322b2436cdbb447a430bb9eb1aff965d07e7e4e | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/core/indexes/interval.py | jle3/pandas | c322b2436cdbb447a430bb9eb1aff965d07e7e4e | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | """ define the IntervalIndex """
from __future__ import annotations
from functools import wraps
from operator import le, lt
import textwrap
from typing import TYPE_CHECKING, Any, Hashable, List, Optional, Tuple, Union, cast
import numpy as np
from pandas._config import get_option
from pandas._libs import lib
from p... | 33.732673 | 96 | 0.596517 | from __future__ import annotations
from functools import wraps
from operator import le, lt
import textwrap
from typing import TYPE_CHECKING, Any, Hashable, List, Optional, Tuple, Union, cast
import numpy as np
from pandas._config import get_option
from pandas._libs import lib
from pandas._libs.interval import Inter... | true | true |
1c267693e129a23e33764db47963b793c4caf706 | 2,020 | py | Python | symphony/cli/pyinventory/graphql/location_children_query.py | englishthomas/magma-1 | a67e255c9d4d6367c0a6186becee85643f9ebe7a | [
"BSD-3-Clause"
] | null | null | null | symphony/cli/pyinventory/graphql/location_children_query.py | englishthomas/magma-1 | a67e255c9d4d6367c0a6186becee85643f9ebe7a | [
"BSD-3-Clause"
] | null | null | null | symphony/cli/pyinventory/graphql/location_children_query.py | englishthomas/magma-1 | a67e255c9d4d6367c0a6186becee85643f9ebe7a | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# @generated AUTOGENERATED file. Do not Change!
from dataclasses import dataclass
from datetime import datetime
from gql.gql.datetime_utils import DATETIME_FIELD
from gql.gql.graphql_client import GraphqlClient
from gql.gql.client import OperationException
from gql.gql.reporter import FailedOper... | 30.149254 | 102 | 0.671287 |
from dataclasses import dataclass
from datetime import datetime
from gql.gql.datetime_utils import DATETIME_FIELD
from gql.gql.graphql_client import GraphqlClient
from gql.gql.client import OperationException
from gql.gql.reporter import FailedOperationException
from functools import partial
from numbers import Numb... | true | true |
1c2676a610dc9135557871bf7f6ecd6b2f82c90e | 9,213 | py | Python | test/functional/example_test.py | martin-braun/HYC | d481ae12de64dc7d19093ee5feee41bc9b50faf9 | [
"MIT"
] | 1 | 2021-12-30T23:59:02.000Z | 2021-12-30T23:59:02.000Z | test/functional/example_test.py | martin-braun/HYC | d481ae12de64dc7d19093ee5feee41bc9b50faf9 | [
"MIT"
] | null | null | null | test/functional/example_test.py | martin-braun/HYC | d481ae12de64dc7d19093ee5feee41bc9b50faf9 | [
"MIT"
] | 1 | 2022-01-10T22:13:04.000Z | 2022-01-10T22:13:04.000Z | #!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""An example functional test
The module-level docstring should include a high-level description of
what the t... | 41.313901 | 133 | 0.682405 |
from collections import defaultdict
from test_framework.blocktools import (create_block, create_coinbase)
from test_framework.mininode import (
CInv,
P2PInterface,
mininode_lock,
msg_block,
msg_getdata,
network_thread_join,
network_thread_start,
)
from test_framework.test_framework i... | true | true |
1c2676dec0455e2dddb3171c1d3ad4e3c9c293c0 | 13,371 | py | Python | sudoku-solver.py | adamkudrnaty/Sudoku-solver | df9b8be16c21e56125ff9ddbf7b1ec2821f803f8 | [
"MIT"
] | 1 | 2020-11-16T15:50:24.000Z | 2020-11-16T15:50:24.000Z | sudoku-solver.py | adamkudrnaty/Sudoku-solver | df9b8be16c21e56125ff9ddbf7b1ec2821f803f8 | [
"MIT"
] | null | null | null | sudoku-solver.py | adamkudrnaty/Sudoku-solver | df9b8be16c21e56125ff9ddbf7b1ec2821f803f8 | [
"MIT"
] | null | null | null | import pygame
import numpy as np
# Drawing the sudoku grid
def draw_the_grid():
for row in range(9):
for column in range(9):
color = BLACK
for numbers in range(1,10):
if grid[row][column] == numbers:
number[row][column] = myfont.render(s... | 43.696078 | 202 | 0.569441 | import pygame
import numpy as np
def draw_the_grid():
for row in range(9):
for column in range(9):
color = BLACK
for numbers in range(1,10):
if grid[row][column] == numbers:
number[row][column] = myfont.render(str(numbers), False, (255, ... | true | true |
1c26771259776272dd7a126c217adb936601e348 | 10,476 | py | Python | scripts/ROM_Hex_Format.py | PulseRain/Reindeer | 7dc3cd18d2c73e273bfafd26d74bb2247b9b1c08 | [
"Apache-2.0"
] | 95 | 2018-11-27T10:16:05.000Z | 2022-03-19T16:05:32.000Z | scripts/ROM_Hex_Format.py | PulseRain/Reindeer | 7dc3cd18d2c73e273bfafd26d74bb2247b9b1c08 | [
"Apache-2.0"
] | 22 | 2019-01-13T20:30:15.000Z | 2019-08-16T04:17:07.000Z | scripts/ROM_Hex_Format.py | PulseRain/Reindeer | 7dc3cd18d2c73e273bfafd26d74bb2247b9b1c08 | [
"Apache-2.0"
] | 23 | 2018-12-06T20:03:31.000Z | 2022-01-21T14:03:38.000Z | #!/usr/bin/python3
###############################################################################
# Copyright (c) 2018, PulseRain Technology LLC
#
# This program is distributed under a dual license: an open source license,
# and a commercial license.
#
# The open source license under which this program is distribu... | 39.8327 | 134 | 0.544292 |
rd_type == self._RECORD_TYPE_16BIT_ADDR_TERM):
start_addr_in_bytes = 2
else:
assert 0, "unknown record type"
if (self._addr_length_in_bytes and addr_length_in_bytes):
addr_length_in_bytes = self._addr_lengt... | true | true |
1c2678b6c3475179fc622fa1bcd7e6a2a96398d4 | 3,619 | py | Python | main.py | HouchangX-AI/Unsupervised-Learning-Defect-Detection | 3c06900fd63e9af6450e8ea52decf92490aa7927 | [
"Apache-2.0"
] | 684 | 2016-08-06T11:52:52.000Z | 2022-03-22T11:50:01.000Z | main.py | HouchangX-AI/Unsupervised-Learning-Defect-Detection | 3c06900fd63e9af6450e8ea52decf92490aa7927 | [
"Apache-2.0"
] | 8 | 2016-10-18T09:27:12.000Z | 2019-09-19T10:16:20.000Z | main.py | HouchangX-AI/Unsupervised-Learning-Defect-Detection | 3c06900fd63e9af6450e8ea52decf92490aa7927 | [
"Apache-2.0"
] | 226 | 2016-08-07T06:02:01.000Z | 2022-02-03T13:33:18.000Z | import tensorflow as tf
import numpy as np
import input_data
import matplotlib.pyplot as plt
import os
from scipy.misc import imsave as ims
from utils import *
from ops import *
class LatentAttention():
def __init__(self):
self.mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
self.n_s... | 44.679012 | 146 | 0.619784 | import tensorflow as tf
import numpy as np
import input_data
import matplotlib.pyplot as plt
import os
from scipy.misc import imsave as ims
from utils import *
from ops import *
class LatentAttention():
def __init__(self):
self.mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
self.n_s... | false | true |
1c26791bd8e300286aa56ecacaf775162d5551cc | 864 | py | Python | userDB/migrations/0006_sshkey.py | raumzeitlabor/benutzerDB-2.0 | a9b2381b6a2cd0a8ee0f448e5dc33e9b57571464 | [
"WTFPL"
] | 2 | 2018-04-02T20:47:06.000Z | 2019-05-30T12:26:29.000Z | userDB/migrations/0006_sshkey.py | slowpoketail/benutzerDB-2.0 | a9b2381b6a2cd0a8ee0f448e5dc33e9b57571464 | [
"WTFPL"
] | 10 | 2018-03-05T00:33:11.000Z | 2018-03-18T18:06:47.000Z | userDB/migrations/0006_sshkey.py | raumzeitlabor/benutzerDB-2.0 | a9b2381b6a2cd0a8ee0f448e5dc33e9b57571464 | [
"WTFPL"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2018-03-04 23:26
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('userDB', '0005_remove_profile_real_name'),
]
opera... | 32 | 138 | 0.609954 |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('userDB', '0005_remove_profile_real_name'),
]
operations = [
migrations.CreateModel(
name='SSHKey',
... | true | true |
1c26792a9dce6ed9ed9f71c88ee91af2c516ff5f | 324 | py | Python | test/test_add_group.py | Nick19912020/python_training | 3af927ef6bd35989073a2f2cb1789d8a8e2a47ac | [
"Apache-2.0"
] | null | null | null | test/test_add_group.py | Nick19912020/python_training | 3af927ef6bd35989073a2f2cb1789d8a8e2a47ac | [
"Apache-2.0"
] | null | null | null | test/test_add_group.py | Nick19912020/python_training | 3af927ef6bd35989073a2f2cb1789d8a8e2a47ac | [
"Apache-2.0"
] | null | null | null | from model.group import Group
def test_add_group(app, db, json_groups):
group = json_groups
old_groups = db.get_group_list()
app.group.create(group)
new_groups = db.get_group_list()
old_groups.append(group)
assert sorted(old_groups, key=Group.id_or_max) == sorted(new_groups, key=Group.id_or_ma... | 27 | 93 | 0.734568 | from model.group import Group
def test_add_group(app, db, json_groups):
group = json_groups
old_groups = db.get_group_list()
app.group.create(group)
new_groups = db.get_group_list()
old_groups.append(group)
assert sorted(old_groups, key=Group.id_or_max) == sorted(new_groups, key=Group.id_or_ma... | true | true |
1c267af8296e616eb9587b8c80e3a73caa87b9b7 | 22,062 | py | Python | diskord/ext/commands/flags.py | Hype3808/diskord | 46162537152866d28eb85cd4bc3b69d5213adf5a | [
"MIT"
] | 30 | 2021-09-16T10:14:06.000Z | 2022-02-28T07:25:48.000Z | diskord/ext/commands/flags.py | Hype3808/diskord | 46162537152866d28eb85cd4bc3b69d5213adf5a | [
"MIT"
] | 25 | 2021-10-01T10:45:34.000Z | 2022-02-11T01:21:26.000Z | diskord/ext/commands/flags.py | Hype3808/diskord | 46162537152866d28eb85cd4bc3b69d5213adf5a | [
"MIT"
] | 14 | 2021-10-02T17:16:53.000Z | 2022-02-19T17:28:46.000Z | """
The MIT License (MIT)
Copyright (c) 2015-present Rapptz
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merg... | 33.17594 | 106 | 0.588523 |
from __future__ import annotations
from .errors import (
BadFlagArgument,
CommandError,
MissingFlagArgument,
TooManyFlags,
MissingRequiredFlag,
)
from diskord.utils import resolve_annotation
from .view import StringView
from .converter import run_converters
from diskord.utils import maybe_corout... | true | true |
1c267b6c08f0644050260f162066f1b0a656ab4f | 2,467 | py | Python | endpoints/csrf.py | andykrohg/quay | 9bae335b742e70d059a0192ad04b0456dcdddc38 | [
"Apache-2.0"
] | null | null | null | endpoints/csrf.py | andykrohg/quay | 9bae335b742e70d059a0192ad04b0456dcdddc38 | [
"Apache-2.0"
] | null | null | null | endpoints/csrf.py | andykrohg/quay | 9bae335b742e70d059a0192ad04b0456dcdddc38 | [
"Apache-2.0"
] | null | null | null | import logging
import os
import base64
import hmac
from functools import wraps
from flask import session, request, Response
import features
from app import app
from auth.auth_context import get_validated_oauth_token
from util.http import abort
logger = logging.getLogger(__name__)
OAUTH_CSRF_TOKEN_NAME = "_oauth_c... | 30.085366 | 100 | 0.713822 | import logging
import os
import base64
import hmac
from functools import wraps
from flask import session, request, Response
import features
from app import app
from auth.auth_context import get_validated_oauth_token
from util.http import abort
logger = logging.getLogger(__name__)
OAUTH_CSRF_TOKEN_NAME = "_oauth_c... | true | true |
1c267c2d09d4713532a350388f95d68d2b91884f | 257 | py | Python | server/apps/core/main/urls.py | NikitaGrishchenko/csp-tender-hack-server | 56055f51bf472f0f1e56b419a48d993cc91e0f3a | [
"MIT"
] | null | null | null | server/apps/core/main/urls.py | NikitaGrishchenko/csp-tender-hack-server | 56055f51bf472f0f1e56b419a48d993cc91e0f3a | [
"MIT"
] | null | null | null | server/apps/core/main/urls.py | NikitaGrishchenko/csp-tender-hack-server | 56055f51bf472f0f1e56b419a48d993cc91e0f3a | [
"MIT"
] | null | null | null | from django.urls import include, path
from .views import MainRedirectView
urlpatterns = [
path("", MainRedirectView.as_view()),
path("api/", include("apps.core.api.urls"), name="api"),
# path("schedule/", include("apps.api.schedule.urls")),
]
| 25.7 | 60 | 0.677043 | from django.urls import include, path
from .views import MainRedirectView
urlpatterns = [
path("", MainRedirectView.as_view()),
path("api/", include("apps.core.api.urls"), name="api"),
]
| true | true |
1c267d943699f678c7179c30f32bd77f0ba0eaed | 671 | py | Python | options/test_options.py | fishfishson/MeshCNN | 8b4ddccf79638c0ca6c1ba17bec287981ddb65a1 | [
"MIT"
] | null | null | null | options/test_options.py | fishfishson/MeshCNN | 8b4ddccf79638c0ca6c1ba17bec287981ddb65a1 | [
"MIT"
] | null | null | null | options/test_options.py | fishfishson/MeshCNN | 8b4ddccf79638c0ca6c1ba17bec287981ddb65a1 | [
"MIT"
] | null | null | null | from .base_options import BaseOptions
class TestOptions(BaseOptions):
def initialize(self):
BaseOptions.initialize(self)
self.parser.add_argument('--results_dir', type=str, default='./results/', help='saves results here.')
self.parser.add_argument('--phase', type=str, default='test', help=... | 51.615385 | 115 | 0.655738 | from .base_options import BaseOptions
class TestOptions(BaseOptions):
def initialize(self):
BaseOptions.initialize(self)
self.parser.add_argument('--results_dir', type=str, default='./results/', help='saves results here.')
self.parser.add_argument('--phase', type=str, default='test', help=... | true | true |
1c267ee1fc03041c91e33d8188f93da3daf89c53 | 4,102 | py | Python | gym/gym/envs/mujoco/half_cheetah_hierarchy.py | SamuelSchmidgall/RodentNavigation | 2ec49c5f43aa456ba648d1117a1b76241ad7a946 | [
"MIT"
] | 2 | 2021-01-03T17:41:02.000Z | 2022-02-28T22:37:48.000Z | gym/gym/envs/mujoco/half_cheetah_hierarchy.py | SamuelSchmidgall/RodentNavigation | 2ec49c5f43aa456ba648d1117a1b76241ad7a946 | [
"MIT"
] | null | null | null | gym/gym/envs/mujoco/half_cheetah_hierarchy.py | SamuelSchmidgall/RodentNavigation | 2ec49c5f43aa456ba648d1117a1b76241ad7a946 | [
"MIT"
] | 1 | 2022-02-28T22:37:48.000Z | 2022-02-28T22:37:48.000Z | import numpy as np
from gym import utils
from gym import spaces
from copy import deepcopy
from gym.envs.mujoco import mujoco_env
class HalfCheetahHierEnv(mujoco_env.MujocoEnv, utils.EzPickle):
def __init__(self, layer=1, ll_agent=None):
self.timestep = 0
self.layer = layer
self.layer2_itr =... | 39.442308 | 111 | 0.565334 | import numpy as np
from gym import utils
from gym import spaces
from copy import deepcopy
from gym.envs.mujoco import mujoco_env
class HalfCheetahHierEnv(mujoco_env.MujocoEnv, utils.EzPickle):
def __init__(self, layer=1, ll_agent=None):
self.timestep = 0
self.layer = layer
self.layer2_itr =... | true | true |
1c267f72cf49aa9404fd2430fe392acd0e28a1a4 | 25,050 | py | Python | packages/python/plotly/plotly/graph_objs/densitymapbox/colorbar/__init__.py | sgn/plotly.py | 587075c9f5a57a3dd60b03b2d47d925fbbb9b9b6 | [
"MIT"
] | 3 | 2020-02-04T21:39:20.000Z | 2020-11-17T19:07:07.000Z | packages/python/plotly/plotly/graph_objs/densitymapbox/colorbar/__init__.py | sgn/plotly.py | 587075c9f5a57a3dd60b03b2d47d925fbbb9b9b6 | [
"MIT"
] | 12 | 2020-06-06T01:22:26.000Z | 2022-03-12T00:13:42.000Z | packages/python/plotly/plotly/graph_objs/densitymapbox/colorbar/__init__.py | sgn/plotly.py | 587075c9f5a57a3dd60b03b2d47d925fbbb9b9b6 | [
"MIT"
] | 17 | 2019-11-21T14:11:29.000Z | 2019-11-21T15:26:23.000Z | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Title(_BaseTraceHierarchyType):
# font
# ----
@property
def font(self):
"""
Sets this color bar's title font. Note that the title's font
used to be set by the now depr... | 34.599448 | 83 | 0.566547 | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Title(_BaseTraceHierarchyType):
@property
def font(self):
return self["font"]
@font.setter
def font(self, val):
self["font"] = val
@property
def ... | true | true |
1c267f78cac105ad28ec7ac57a91b49760f32c7c | 806 | py | Python | tests/conftest.py | worldbeater/dta | 79ba4efa921e7f712fe7af74f4a8059460f703e3 | [
"MIT"
] | 2 | 2022-02-22T20:48:11.000Z | 2022-03-27T15:03:47.000Z | tests/conftest.py | worldbeater/dta | 79ba4efa921e7f712fe7af74f4a8059460f703e3 | [
"MIT"
] | 11 | 2022-02-23T17:39:28.000Z | 2022-03-27T22:12:31.000Z | tests/conftest.py | worldbeater/dta | 79ba4efa921e7f712fe7af74f4a8059460f703e3 | [
"MIT"
] | 7 | 2022-02-23T17:15:31.000Z | 2022-03-30T15:07:22.000Z | import os
import signal
import pytest
from flask import Flask
from flask.testing import FlaskClient
from webapp.app import configure_app
from webapp.repositories import AppDatabase
@pytest.fixture()
def app(request) -> Flask:
src = os.getcwd()
tests = os.path.join(src, "tests")
app = configure_app(test... | 23.028571 | 71 | 0.715881 | import os
import signal
import pytest
from flask import Flask
from flask.testing import FlaskClient
from webapp.app import configure_app
from webapp.repositories import AppDatabase
@pytest.fixture()
def app(request) -> Flask:
src = os.getcwd()
tests = os.path.join(src, "tests")
app = configure_app(test... | true | true |
1c267fa7c1b3bd880e9c6f7bb01018cf88df7c17 | 264 | py | Python | Leetcode/0705. Design HashSet/0705.py | Next-Gen-UI/Code-Dynamics | a9b9d5e3f27e870b3e030c75a1060d88292de01c | [
"MIT"
] | null | null | null | Leetcode/0705. Design HashSet/0705.py | Next-Gen-UI/Code-Dynamics | a9b9d5e3f27e870b3e030c75a1060d88292de01c | [
"MIT"
] | null | null | null | Leetcode/0705. Design HashSet/0705.py | Next-Gen-UI/Code-Dynamics | a9b9d5e3f27e870b3e030c75a1060d88292de01c | [
"MIT"
] | null | null | null | class MyHashSet:
def __init__(self):
self.set = [False] * 1000001
def add(self, key: int) -> None:
self.set[key] = True
def remove(self, key: int) -> None:
self.set[key] = False
def contains(self, key: int) -> bool:
return self.set[key]
| 20.307692 | 39 | 0.609848 | class MyHashSet:
def __init__(self):
self.set = [False] * 1000001
def add(self, key: int) -> None:
self.set[key] = True
def remove(self, key: int) -> None:
self.set[key] = False
def contains(self, key: int) -> bool:
return self.set[key]
| true | true |
1c2680798d6338584b084ca7698d0aff3e4e6a5b | 4,904 | py | Python | busy_beaver/apps/slack_integration/event_subscription.py | alysivji/github-adapter | 5e3543f41f189fbe4a50d64e3d6734dc765579b4 | [
"MIT"
] | 55 | 2019-05-05T01:20:58.000Z | 2022-01-10T18:03:05.000Z | busy_beaver/apps/slack_integration/event_subscription.py | alysivji/github-adapter | 5e3543f41f189fbe4a50d64e3d6734dc765579b4 | [
"MIT"
] | 222 | 2019-05-03T16:31:26.000Z | 2021-08-28T23:49:03.000Z | busy_beaver/apps/slack_integration/event_subscription.py | busy-beaver-dev/busy-beaver | 5e3543f41f189fbe4a50d64e3d6734dc765579b4 | [
"MIT"
] | 19 | 2019-04-27T19:49:32.000Z | 2020-06-30T19:52:09.000Z | import logging
from .blocks import AppHome
from .interactors import generate_help_text
from busy_beaver.common.wrappers import SlackClient
from busy_beaver.extensions import db
from busy_beaver.models import SlackInstallation, SlackUser
from busy_beaver.toolbox import EventEmitter
logger = logging.getLogger(__name__)... | 31.435897 | 87 | 0.705343 | import logging
from .blocks import AppHome
from .interactors import generate_help_text
from busy_beaver.common.wrappers import SlackClient
from busy_beaver.extensions import db
from busy_beaver.models import SlackInstallation, SlackUser
from busy_beaver.toolbox import EventEmitter
logger = logging.getLogger(__name__)... | true | true |
1c26816f8ac051ab9f0c91025e252f4213ec8cd6 | 7,603 | py | Python | lib/rucio/core/meta.py | fno2010/rucio | 47e93cfbe5887071c70de4ba815c1bbdddfac2ce | [
"Apache-2.0"
] | null | null | null | lib/rucio/core/meta.py | fno2010/rucio | 47e93cfbe5887071c70de4ba815c1bbdddfac2ce | [
"Apache-2.0"
] | null | null | null | lib/rucio/core/meta.py | fno2010/rucio | 47e93cfbe5887071c70de4ba815c1bbdddfac2ce | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright CERN since 2012
#
# 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 ... | 40.227513 | 226 | 0.666711 |
from __future__ import print_function
from re import match
from six import string_types
from sqlalchemy.exc import IntegrityError
from sqlalchemy.orm.exc import NoResultFound
from rucio.common.constraints import AUTHORIZED_VALUE_TYPES
from rucio.common.exception import (Duplicate, RucioException,
... | true | true |
1c268208b1750c22b4c8c9eae8a15053f71da496 | 10,707 | py | Python | contrib/devtools/update-translations.py | nagrath/ICS | facf2f3654fdf5e092ff07bd7aeb34d4b89e77b8 | [
"MIT"
] | null | null | null | contrib/devtools/update-translations.py | nagrath/ICS | facf2f3654fdf5e092ff07bd7aeb34d4b89e77b8 | [
"MIT"
] | null | null | null | contrib/devtools/update-translations.py | nagrath/ICS | facf2f3654fdf5e092ff07bd7aeb34d4b89e77b8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Run this script from the root of the repository to update all translations from
transifex.
It will do the foll... | 39.363971 | 154 | 0.63239 |
import argparse
import subprocess
import re
import sys
import os
import io
import xml.etree.ElementTree as ET
TX = 'tx'
SOURCE_LANG = 'iqcash_en.ts'
LOCALE_DIR = 'src/qt/locale'
MIN_NUM_MESSAGES = 10
MINIMUM_PERC = 80
GIT = os.getenv("GIT", "git")
def check_at_repository_root():
if not os.path.exists('.... | true | true |
1c2682a9ab2bd169d4f4d48f4f27f2adfd736928 | 1,019 | py | Python | src/process_quests.py | faycalki/tainted-paths | 81cecf6c1fba903ec3b8043e22652d222892609d | [
"MIT"
] | 4 | 2019-09-26T21:34:32.000Z | 2021-11-18T19:31:15.000Z | src/process_quests.py | faycalki/tainted-paths | 81cecf6c1fba903ec3b8043e22652d222892609d | [
"MIT"
] | null | null | null | src/process_quests.py | faycalki/tainted-paths | 81cecf6c1fba903ec3b8043e22652d222892609d | [
"MIT"
] | null | null | null | import sys
sys.dont_write_bytecode = True
import string
from module_info import *
from module_quests import *
from process_common import *
# Lav's export_dir tweak
export_dir = '%s/' % export_dir.replace('\\', '/').rstrip('/')
def save_quests():
ofile = open(export_dir + "quests.txt","w")
ofile.write("questsfi... | 26.128205 | 87 | 0.661433 | import sys
sys.dont_write_bytecode = True
import string
from module_info import *
from module_quests import *
from process_common import *
export_dir = '%s/' % export_dir.replace('\\', '/').rstrip('/')
def save_quests():
ofile = open(export_dir + "quests.txt","w")
ofile.write("questsfile version 1\n")
ofile... | false | true |
1c2682e15e9a175fc49d873b4afab7259a2b9447 | 999 | py | Python | polypheny/auth.py | polypheny/Polypheny-Connector-Python | 7425eb01d76209783898a01b7a75e3923e911e67 | [
"Apache-2.0"
] | 3 | 2021-10-31T17:34:47.000Z | 2021-11-01T13:31:11.000Z | polypheny/auth.py | polypheny/Polypheny-Connector-Python | 7425eb01d76209783898a01b7a75e3923e911e67 | [
"Apache-2.0"
] | null | null | null | polypheny/auth.py | polypheny/Polypheny-Connector-Python | 7425eb01d76209783898a01b7a75e3923e911e67 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2019-2021 The Polypheny Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#... | 31.21875 | 75 | 0.716717 |
import os
CLIENT_PROOF_SIZE = 32
CLIENT_KEY_SIZE = 64
class AuthManager(object):
def __init__(self, connection, user, password):
self.connection = connection
self.user = user
self.password = password
self.method = b"SCRAMSHA256"
self.client_key = os.urand... | true | true |
1c26834c8fbe812a0d460cfeb5be08b746d78e7c | 9,007 | py | Python | cogs/cmds/config.py | Zelou22/Villager-Bot | 81f8310f0d871709ba1c4fd579009cfc41d14426 | [
"MIT"
] | 2 | 2021-02-13T12:38:13.000Z | 2021-05-14T11:52:30.000Z | cogs/cmds/config.py | Zelou22/Villager-Bot | 81f8310f0d871709ba1c4fd579009cfc41d14426 | [
"MIT"
] | null | null | null | cogs/cmds/config.py | Zelou22/Villager-Bot | 81f8310f0d871709ba1c4fd579009cfc41d14426 | [
"MIT"
] | null | null | null | from discord.ext import commands
import discord
class Config(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.d = bot.d
self.db = bot.get_cog('Database')
@commands.group(name='config', aliases=['settings', 'conf', 'gamerule'])
async def config(self, ctx):
if c... | 44.151961 | 147 | 0.629288 | from discord.ext import commands
import discord
class Config(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.d = bot.d
self.db = bot.get_cog('Database')
@commands.group(name='config', aliases=['settings', 'conf', 'gamerule'])
async def config(self, ctx):
if c... | true | true |
1c2683c26ff9c1cb7f7735509c0523189a76fcc8 | 950 | py | Python | waitress/settings/development.py | andela/waitress | 55d4b99d2e5263a11609b18d478b2e514d79a7e8 | [
"MIT"
] | 2 | 2018-03-13T13:43:32.000Z | 2019-07-30T02:56:48.000Z | waitress/settings/development.py | waitress-andela/waitress | 55d4b99d2e5263a11609b18d478b2e514d79a7e8 | [
"MIT"
] | 16 | 2016-07-31T16:53:01.000Z | 2020-02-14T00:00:27.000Z | waitress/settings/development.py | andela-osule/waitress | 55d4b99d2e5263a11609b18d478b2e514d79a7e8 | [
"MIT"
] | 2 | 2017-01-15T03:25:00.000Z | 2018-10-29T15:19:27.000Z | # -*- coding: utf-8 -*-
import os
from os.path import dirname, join
from dotenv import load_dotenv
from .base import *
dotenv_path = join(dirname(__file__), ".env")
load_dotenv(dotenv_path)
INSTALLED_APPS += ("django_nose",)
TEST_RUNNER = "django_nose.NoseTestSuiteRunner"
NOSE_ARGS = ["--with-coverage"]
ALLOWED... | 27.941176 | 121 | 0.647368 |
import os
from os.path import dirname, join
from dotenv import load_dotenv
from .base import *
dotenv_path = join(dirname(__file__), ".env")
load_dotenv(dotenv_path)
INSTALLED_APPS += ("django_nose",)
TEST_RUNNER = "django_nose.NoseTestSuiteRunner"
NOSE_ARGS = ["--with-coverage"]
ALLOWED_HOSTS = ["*"]
DATABA... | true | true |
1c26841c68eb52a1d3ef2d907670a2bcbe3a5d6e | 643 | py | Python | tests/activity_log_test.py | al-fontes-jr/bardolph | 209bba49765c729d8f1479903593043cef274aab | [
"Apache-2.0"
] | null | null | null | tests/activity_log_test.py | al-fontes-jr/bardolph | 209bba49765c729d8f1479903593043cef274aab | [
"Apache-2.0"
] | 16 | 2020-06-15T11:04:10.000Z | 2022-03-28T05:39:10.000Z | tests/activity_log_test.py | al-fontes-jr/bardolph | 209bba49765c729d8f1479903593043cef274aab | [
"Apache-2.0"
] | 1 | 2020-06-24T02:01:04.000Z | 2020-06-24T02:01:04.000Z | #!/usr/bin/env python
import unittest
from bardolph.fakes.fake_lifx import ActivityMonitor
class ActivityLogTest(unittest.TestCase):
def setUp(self): pass
def test_calls(self):
activities = ActivityMonitor()
activities.log_call("a", (1, 2))
activities.log_call("b", (3, 4))
ac... | 26.791667 | 64 | 0.622084 |
import unittest
from bardolph.fakes.fake_lifx import ActivityMonitor
class ActivityLogTest(unittest.TestCase):
def setUp(self): pass
def test_calls(self):
activities = ActivityMonitor()
activities.log_call("a", (1, 2))
activities.log_call("b", (3, 4))
activities.log_call("a"... | true | true |
1c2684889420c1907afdd6c54e34503149e4ec4e | 541 | py | Python | ML/model.py | lucascallado/flan | 74364a1db278214dd31ca2a70741e16babf5898a | [
"MIT"
] | 9 | 2017-11-16T14:39:44.000Z | 2022-03-27T06:24:31.000Z | ML/model.py | lucascallado/flan | 74364a1db278214dd31ca2a70741e16babf5898a | [
"MIT"
] | null | null | null | ML/model.py | lucascallado/flan | 74364a1db278214dd31ca2a70741e16babf5898a | [
"MIT"
] | 2 | 2017-10-25T18:34:05.000Z | 2021-04-07T22:59:46.000Z | import numpy as np
import pandas as pd
import json
import csv
import pandas as pd
from sklearn.neighbors import KNeighborsClassifier
from sklearn.naive_bayes import GaussianNB
from numpy import genfromtxt
x_temp = np.asarray(genfromtxt('x.csv', delimiter=',', dtype='str'))
x = (x_temp.view(np.ubyte)-96).astype('int32'... | 24.590909 | 91 | 0.748614 | import numpy as np
import pandas as pd
import json
import csv
import pandas as pd
from sklearn.neighbors import KNeighborsClassifier
from sklearn.naive_bayes import GaussianNB
from numpy import genfromtxt
x_temp = np.asarray(genfromtxt('x.csv', delimiter=',', dtype='str'))
x = (x_temp.view(np.ubyte)-96).astype('int32'... | false | true |
1c268538721fbe98137ca75cfeef81faf63e8c02 | 825 | py | Python | coderedcms/migrations/0009_auto_20190201_1546.py | fakegit/coderedcms | 10dd10635bba9c2dcecede4b8e557b5a6ffd8b23 | [
"BSD-3-Clause"
] | 526 | 2018-07-31T20:14:17.000Z | 2022-03-23T08:08:29.000Z | coderedcms/migrations/0009_auto_20190201_1546.py | fakegit/coderedcms | 10dd10635bba9c2dcecede4b8e557b5a6ffd8b23 | [
"BSD-3-Clause"
] | 325 | 2018-08-01T13:53:55.000Z | 2022-03-31T15:08:28.000Z | coderedcms/migrations/0009_auto_20190201_1546.py | fakegit/coderedcms | 10dd10635bba9c2dcecede4b8e557b5a6ffd8b23 | [
"BSD-3-Clause"
] | 153 | 2018-08-02T07:42:40.000Z | 2022-03-24T23:54:59.000Z | # Generated by Django 2.1.5 on 2019-02-01 20:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('coderedcms', '0008_auto_20190122_1242'),
]
operations = [
migrations.AlterField(
model_name='coderedpage',
name='ind... | 43.421053 | 473 | 0.666667 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('coderedcms', '0008_auto_20190122_1242'),
]
operations = [
migrations.AlterField(
model_name='coderedpage',
name='index_order_by',
field=models.CharFiel... | true | true |
1c2685ef1e00fee3cb43d83a0888d4955b037516 | 15,244 | py | Python | tests/dopamine/jax/agents/rainbow/rainbow_agent_test.py | kuldeepbrd1/dopamine | e87f2e020205400dbb10bf7cbd1672547a1488e0 | [
"Apache-2.0"
] | 9,825 | 2018-08-27T18:09:12.000Z | 2022-03-31T09:03:27.000Z | tests/dopamine/jax/agents/rainbow/rainbow_agent_test.py | soma2000-lang/dopamine | 1cbed6c7c35163e73b0ee2f2d2bf032b057570dd | [
"Apache-2.0"
] | 169 | 2018-08-28T08:42:20.000Z | 2022-03-21T16:22:39.000Z | tests/dopamine/jax/agents/rainbow/rainbow_agent_test.py | soma2000-lang/dopamine | 1cbed6c7c35163e73b0ee2f2d2bf032b057570dd | [
"Apache-2.0"
] | 1,465 | 2018-08-27T18:15:20.000Z | 2022-03-20T10:44:16.000Z | # coding=utf-8
# Copyright 2018 The Dopamine Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 44.703812 | 80 | 0.68112 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl.testing import absltest
from dopamine.discrete_domains import atari_lib
from dopamine.jax.agents.dqn import dqn_agent
from dopamine.jax.agents.rainbow import rainbow_agent
from dopami... | true | true |
1c26863883b28e0d9796479fc361205a1a3333be | 813 | py | Python | Easy/213. String Compression/Solution.py | Zhenye-Na/LxxxCode | afd79d790d0a7495d75e6650f80adaa99bd0ff07 | [
"MIT"
] | 12 | 2019-05-04T04:21:27.000Z | 2022-03-02T07:06:57.000Z | Easy/213. String Compression/Solution.py | Zhenye-Na/LxxxCode | afd79d790d0a7495d75e6650f80adaa99bd0ff07 | [
"MIT"
] | 1 | 2019-07-24T18:43:53.000Z | 2019-07-24T18:43:53.000Z | Easy/213. String Compression/Solution.py | Zhenye-Na/LxxxCode | afd79d790d0a7495d75e6650f80adaa99bd0ff07 | [
"MIT"
] | 10 | 2019-07-01T04:03:04.000Z | 2022-03-09T03:57:37.000Z | class Solution:
"""
@param originalString: a string
@return: a compressed string
"""
def compress(self, originalString):
# write your code here
if not originalString or len(originalString) == 1:
return originalString
mapping = {}
mapping[originalString[0]... | 31.269231 | 86 | 0.574416 | class Solution:
def compress(self, originalString):
if not originalString or len(originalString) == 1:
return originalString
mapping = {}
mapping[originalString[0]] = 0
result = ""
for os in originalString:
if os not in mapping:
... | true | true |
1c26870056fa3cca6807016e4cf29689ca558e5b | 16,808 | py | Python | civis/tests/test_futures.py | civisanalytics/civis-python | 96a31a77fcf7c9678052f55aafe2939e9f56874f | [
"BSD-3-Clause"
] | 31 | 2016-11-14T14:26:24.000Z | 2021-11-19T15:43:45.000Z | civis/tests/test_futures.py | civisanalytics/civis-python | 96a31a77fcf7c9678052f55aafe2939e9f56874f | [
"BSD-3-Clause"
] | 296 | 2016-11-11T20:52:59.000Z | 2022-02-23T13:34:37.000Z | civis/tests/test_futures.py | civisanalytics/civis-python | 96a31a77fcf7c9678052f55aafe2939e9f56874f | [
"BSD-3-Clause"
] | 40 | 2016-11-11T20:48:13.000Z | 2021-04-22T17:47:09.000Z | import os
from operator import itemgetter
from unittest import mock
import pytest
from civis import APIClient, response
from civis.base import CivisAPIError, CivisJobFailure
from civis.resources import API_SPEC
from civis.resources._resources import get_api_spec, generate_classes
from civis.futures import (ContainerF... | 35.236897 | 79 | 0.637673 | import os
from operator import itemgetter
from unittest import mock
import pytest
from civis import APIClient, response
from civis.base import CivisAPIError, CivisJobFailure
from civis.resources import API_SPEC
from civis.resources._resources import get_api_spec, generate_classes
from civis.futures import (ContainerF... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.