hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | 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 209 | max_issues_repo_name stringlengths 5 121 | 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 209 | max_forks_repo_name stringlengths 5 121 | 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 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8baa0bbad2a459368cf5f2bc12134a0f82c3948a | 1,961 | py | Python | new_component/_config.py | iancleary/new-component | f287fb2afd34a5aa50e043c190bd35179e5816b9 | [
"MIT"
] | null | null | null | new_component/_config.py | iancleary/new-component | f287fb2afd34a5aa50e043c190bd35179e5816b9 | [
"MIT"
] | 4 | 2022-02-02T06:57:06.000Z | 2022-02-05T01:05:52.000Z | new_component/_config.py | iancleary/new-component | f287fb2afd34a5aa50e043c190bd35179e5816b9 | [
"MIT"
] | 1 | 2022-02-03T03:29:05.000Z | 2022-02-03T03:29:05.000Z | import json
from new_component._constants import (
DEFAULT_COMPONENTS_DIR,
DEFAULT_FILE_EXTENSION,
GLOBAL_CONFIG_FILE,
LOCAL_CONFIG_FILE,
)
def _load_config() -> dict:
"""
Loads config from global and local scopes, if they exist.
"""
file_config = {}
if LOCAL_CONFIG_FILE.exists()... | 26.863014 | 75 | 0.650178 |
f32178d0c19a0d32978de362d5e6255491b0f42b | 5,052 | py | Python | shunqiwang/middlewares.py | JonnyLe/shunqiwang_by_scrapy | 174e3cf0afa4ee2e137b88b0a40877ad1e9f95cb | [
"Apache-2.0"
] | 4 | 2019-05-02T01:31:14.000Z | 2019-12-06T02:07:14.000Z | shunqiwang/middlewares.py | JonnyLe/shunqiwang_by_scrapy | 174e3cf0afa4ee2e137b88b0a40877ad1e9f95cb | [
"Apache-2.0"
] | null | null | null | shunqiwang/middlewares.py | JonnyLe/shunqiwang_by_scrapy | 174e3cf0afa4ee2e137b88b0a40877ad1e9f95cb | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Define here the models for your spider middleware
#
# See documentation in:
# https://doc.scrapy.org/en/latest/topics/spider-middleware.html
from scrapy import signals
from shunqiwang import settings
import logging,random,base64
class ShunqiwangSpiderMiddleware(object):
# Not all metho... | 35.083333 | 81 | 0.666271 |
4b43c33eb40c771ba7d85025bfc42e91538dbbe9 | 28,100 | py | Python | Urcheon/Bsp.py | necessarily-equal/Urcheon | 1a6ce7acf5d0c9ac12dc3e51f0de9bf537c8d433 | [
"0BSD"
] | 5 | 2015-03-11T05:45:49.000Z | 2015-12-08T09:53:30.000Z | Urcheon/Bsp.py | necessarily-equal/Urcheon | 1a6ce7acf5d0c9ac12dc3e51f0de9bf537c8d433 | [
"0BSD"
] | 20 | 2015-03-09T01:16:36.000Z | 2017-02-13T09:51:02.000Z | Urcheon/Bsp.py | necessarily-equal/Urcheon | 1a6ce7acf5d0c9ac12dc3e51f0de9bf537c8d433 | [
"0BSD"
] | 1 | 2022-01-08T01:13:12.000Z | 2022-01-08T01:13:12.000Z | #! /usr/bin/env python3
#-*- coding: UTF-8 -*-
### Legal
#
# Author: Thomas DEBESSE <dev@illwieckz.net>
# License: ISC
#
from Urcheon import Map
from Urcheon import Ui
import __main__ as m
import argparse
import glob
import json
import logging
import os
import struct
import sys
from collections import OrderedDict
fr... | 30.280172 | 171 | 0.707616 |
4fa55b586a53d43d9286ac94aa4bcd43d38c4008 | 9,757 | py | Python | cGAN/fid/fid_score.py | youngleox/gmu | 0ab963976098ce7861c462ddae136ac92edd9916 | [
"MIT"
] | null | null | null | cGAN/fid/fid_score.py | youngleox/gmu | 0ab963976098ce7861c462ddae136ac92edd9916 | [
"MIT"
] | null | null | null | cGAN/fid/fid_score.py | youngleox/gmu | 0ab963976098ce7861c462ddae136ac92edd9916 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""Calculates the Frechet Inception Distance (FID) to evalulate GANs
The FID metric calculates the distance between two distributions of images.
Typically, we have summary statistics (mean & covariance matrix) of one
of these distributions, while the 2nd distribution is given by a GAN.
When run... | 36.958333 | 79 | 0.631547 |
f6a55cfd624929913c5f642c96f4adf56a07c38e | 6,106 | py | Python | qa/rpc-tests/proxy_test.py | wealthsilo/WealthSilo | 318df3155e8ede3e2c34fd4b02bf4a7ee8d53e65 | [
"MIT"
] | null | null | null | qa/rpc-tests/proxy_test.py | wealthsilo/WealthSilo | 318df3155e8ede3e2c34fd4b02bf4a7ee8d53e65 | [
"MIT"
] | null | null | null | qa/rpc-tests/proxy_test.py | wealthsilo/WealthSilo | 318df3155e8ede3e2c34fd4b02bf4a7ee8d53e65 | [
"MIT"
] | 1 | 2018-08-10T23:57:27.000Z | 2018-08-10T23:57:27.000Z | #!/usr/bin/env python2
# Copyright (c) 2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import socket
import traceback, sys
from binascii import hexlify
import time, os
from socks5 import Socks5Conf... | 41.821918 | 145 | 0.653456 |
1197c6e086f1809a25a9f2b8aaf11d9ec00a9158 | 1,154 | py | Python | codetools/contexts/adapter/unit_corrector_adapter.py | braidedlogix/Codetools_wxPhoenix_py3 | 555e7e3e4895ef9d79716e0323db4445436d10dc | [
"BSD-3-Clause"
] | 1 | 2017-05-12T04:17:50.000Z | 2017-05-12T04:17:50.000Z | codetools/contexts/adapter/unit_corrector_adapter.py | braidedlogix/Codetools_wxPhoenix_py3 | 555e7e3e4895ef9d79716e0323db4445436d10dc | [
"BSD-3-Clause"
] | null | null | null | codetools/contexts/adapter/unit_corrector_adapter.py | braidedlogix/Codetools_wxPhoenix_py3 | 555e7e3e4895ef9d79716e0323db4445436d10dc | [
"BSD-3-Clause"
] | null | null | null | #
# (C) Copyright 2013 Enthought, Inc., Austin, TX
# All right reserved.
#
# This file is open source software distributed according to the terms in
# LICENSE.txt
#
# ETS library imports
from scimath.units.api import UnitArray
from traits.api import Dict
# Local imports
from .unit_manipulation_adapter import UnitMani... | 34.969697 | 79 | 0.747834 |
e8bd92fd3641fad6d9666323bf38d8ccc7a3b89a | 8,088 | py | Python | tests/test_decorators.py | jrcastro2/invenio-oauth2server | f74bbe1ea19656831ac94946999100b65e6fe7dd | [
"MIT"
] | 3 | 2015-08-19T12:51:12.000Z | 2017-10-25T00:58:52.000Z | tests/test_decorators.py | jrcastro2/invenio-oauth2server | f74bbe1ea19656831ac94946999100b65e6fe7dd | [
"MIT"
] | 157 | 2015-08-04T12:14:23.000Z | 2021-06-02T14:59:10.000Z | tests/test_decorators.py | jrcastro2/invenio-oauth2server | f74bbe1ea19656831ac94946999100b65e6fe7dd | [
"MIT"
] | 44 | 2015-08-03T17:05:27.000Z | 2022-01-19T19:06:53.000Z | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""OAuth2Server decorators test cases."""
from datetime import datetime
from flask ... | 35.473684 | 77 | 0.64095 |
cb97cb2847f62660de92107b03cea21d59ec390f | 56,829 | py | Python | packager/third_party/protobuf/python/google/protobuf/internal/python_message.py | koln67/shaka-packager | 5b9fd409a5de502e8af2e46ee12840bd2226874d | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 11,356 | 2017-12-08T19:42:32.000Z | 2022-03-31T16:55:25.000Z | packager/third_party/protobuf/python/google/protobuf/internal/python_message.py | koln67/shaka-packager | 5b9fd409a5de502e8af2e46ee12840bd2226874d | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2,402 | 2017-12-08T22:31:01.000Z | 2022-03-28T19:25:52.000Z | packager/third_party/protobuf/python/google/protobuf/internal/python_message.py | koln67/shaka-packager | 5b9fd409a5de502e8af2e46ee12840bd2226874d | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1,343 | 2017-12-08T19:47:19.000Z | 2022-03-26T11:31:36.000Z | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redi... | 36.925926 | 80 | 0.719703 |
e36f30f59f3375e746e9dcaafc157e55197654f4 | 3,787 | py | Python | google/ads/google_ads/v5/proto/errors/null_error_pb2.py | arammaliachi/google-ads-python | a4fe89567bd43eb784410523a6306b5d1dd9ee67 | [
"Apache-2.0"
] | 1 | 2021-04-09T04:28:47.000Z | 2021-04-09T04:28:47.000Z | google/ads/google_ads/v5/proto/errors/null_error_pb2.py | arammaliachi/google-ads-python | a4fe89567bd43eb784410523a6306b5d1dd9ee67 | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/v5/proto/errors/null_error_pb2.py | arammaliachi/google-ads-python | a4fe89567bd43eb784410523a6306b5d1dd9ee67 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/ads/googleads_v5/proto/errors/null_error.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.prot... | 37.49505 | 583 | 0.784262 |
67ee8ee2ecad5411e464e1c3925a386a07aad4ee | 211 | py | Python | src/ggrc/__init__.py | HLD/ggrc-core | 9bdc0fc6ca9e252f4919db682d80e360d5581eb4 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/ggrc/__init__.py | HLD/ggrc-core | 9bdc0fc6ca9e252f4919db682d80e360d5581eb4 | [
"ECL-2.0",
"Apache-2.0"
] | 10 | 2018-07-06T00:04:23.000Z | 2021-02-26T21:13:20.000Z | src/ggrc/__init__.py | HLD/ggrc-core | 9bdc0fc6ca9e252f4919db682d80e360d5581eb4 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2017-11-11T22:16:56.000Z | 2017-11-11T22:16:56.000Z | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Main GGRC module"""
from ggrc import bootstrap
db = bootstrap.get_db()
__all__ = [
db
]
| 16.230769 | 78 | 0.691943 |
44d22c1abc256e8faef7f13f72edf84e91331703 | 188,614 | py | Python | plotly/graph_objs/_layout.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 2 | 2018-12-03T15:20:42.000Z | 2018-12-03T15:20:47.000Z | plotly/graph_objs/_layout.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | null | null | null | plotly/graph_objs/_layout.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 2 | 2019-06-17T01:35:57.000Z | 2020-11-03T01:07:19.000Z | from plotly.basedatatypes import BaseLayoutType
import copy
class Layout(BaseLayoutType):
# angularaxis
# -----------
@property
def angularaxis(self):
"""
The 'angularaxis' property is an instance of AngularAxis
that may be specified as:
- An instance of plotly.graph... | 43.279945 | 82 | 0.541344 |
7f4715a74fae0d464817a33e481f32c602b49ea2 | 2,469 | py | Python | doc/source/conf.py | jbemmel/nuage-openstack-neutron | e356c017f7e1600b72cfc26abb588c7cf636e925 | [
"Apache-2.0"
] | 14 | 2015-06-24T18:35:25.000Z | 2020-09-21T07:14:06.000Z | doc/source/conf.py | jbemmel/nuage-openstack-neutron | e356c017f7e1600b72cfc26abb588c7cf636e925 | [
"Apache-2.0"
] | 7 | 2016-01-20T18:20:28.000Z | 2020-11-18T16:04:14.000Z | doc/source/conf.py | jbemmel/nuage-openstack-neutron | e356c017f7e1600b72cfc26abb588c7cf636e925 | [
"Apache-2.0"
] | 43 | 2015-04-07T09:02:35.000Z | 2021-02-12T07:50:19.000Z | # -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software... | 32.486842 | 79 | 0.696638 |
333f1a65839bd7d26da5f0cf1278a6f817d7e4e4 | 1,547 | py | Python | integrationtest/vm/multihosts/test_create_vm.py | sherry546/zstack-woodpecker | 54a37459f2d72ce6820974feaa6eb55772c3d2ce | [
"Apache-2.0"
] | 2 | 2016-03-23T08:45:44.000Z | 2017-06-26T02:40:46.000Z | integrationtest/vm/multihosts/test_create_vm.py | KevinDavidMitnick/zstack-woodpecker | 96257faaf3c362168d008bdb47002025ad669b24 | [
"Apache-2.0"
] | null | null | null | integrationtest/vm/multihosts/test_create_vm.py | KevinDavidMitnick/zstack-woodpecker | 96257faaf3c362168d008bdb47002025ad669b24 | [
"Apache-2.0"
] | 2 | 2020-03-12T03:11:28.000Z | 2021-07-26T01:57:58.000Z | '''
New Integration Test for creating KVM VM.
@author: Youyk
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.operations.resource_operations as res_ops
import zstackwoodpecker.zstack_tes... | 31.571429 | 99 | 0.729153 |
4e32c5713fb76a3b051c87d542a8378521a94b25 | 1,103 | py | Python | instaclone/images/urls.py | chois9105/instaclone | 20b1852c05eddf018dcdfffa5a3fc355a70ade9a | [
"MIT"
] | null | null | null | instaclone/images/urls.py | chois9105/instaclone | 20b1852c05eddf018dcdfffa5a3fc355a70ade9a | [
"MIT"
] | null | null | null | instaclone/images/urls.py | chois9105/instaclone | 20b1852c05eddf018dcdfffa5a3fc355a70ade9a | [
"MIT"
] | null | null | null | from django.conf.urls import url
from . import views
urlpatterns = [
url(
regex=r'^$',
view=views.Feed.as_view(),
name='feed'
),
url(
regex=r'^(?P<image_id>[0-9]+)/$',
view=views.ImageDetail.as_view(),
name='image_detail'
),
url (
regex=r'^(?... | 24.511111 | 73 | 0.510426 |
b82a425f683fb8c5aa38a33d70a41d2b007d47e0 | 4,528 | py | Python | flask/models/manager/errors.py | geovote/geovote-main | b848fba73c51c112cdc235f6d5240f5e8706332f | [
"MIT"
] | null | null | null | flask/models/manager/errors.py | geovote/geovote-main | b848fba73c51c112cdc235f6d5240f5e8706332f | [
"MIT"
] | 46 | 2018-12-29T22:30:21.000Z | 2019-02-04T10:47:32.000Z | flask/models/manager/errors.py | geovote/geovote-main | b848fba73c51c112cdc235f6d5240f5e8706332f | [
"MIT"
] | null | null | null | import re
import traceback
from sqlalchemy.exc import DataError
from sqlalchemy import CHAR, \
Column,\
Enum,\
Float,\
Integer,\
String
from models.utils.api_errors import ApiErrors
from utils.logger impo... | 44.831683 | 142 | 0.57288 |
391dc3258ba2bacf56569912ebfdc8e3dc5d570b | 5,735 | py | Python | public/tgt_files/generate_test_rot.py | sheerkarny/OnPoint | 05f47ef7c9377a1a267ee3cdfa8947a074beb648 | [
"MIT"
] | 19 | 2020-07-03T18:25:48.000Z | 2021-12-10T05:16:06.000Z | public/tgt_files/generate_test_rot.py | sheerkarny/OnPoint | 05f47ef7c9377a1a267ee3cdfa8947a074beb648 | [
"MIT"
] | 1 | 2021-08-03T13:15:46.000Z | 2021-08-24T10:04:47.000Z | public/tgt_files/generate_test_rot.py | sheerkarny/OnPoint | 05f47ef7c9377a1a267ee3cdfa8947a074beb648 | [
"MIT"
] | 4 | 2020-08-25T13:16:41.000Z | 2021-08-18T08:06:45.000Z | """
This script is for generating JSON target files directly, which is the form used in the experiment.
To implement target jump, clamp, or online feedback make appropriate changes in the area flagged by the **TODO** comment.
"""
import json
import random
def generateTargetAngles(numTargets):
"""
temporary us... | 37.730263 | 162 | 0.625283 |
9d39c1a59ac8fb7a5b633f9fc332e02a3fd1ec8b | 1,818 | py | Python | launch/test/launch/launch_description_source/test_python_launch_description_source.py | bedieber/launch | 4dfe69763379e405df7a21bde536aad7e39fdd93 | [
"Apache-2.0"
] | 67 | 2015-06-12T21:17:24.000Z | 2022-03-30T07:19:52.000Z | launch/test/launch/launch_description_source/test_python_launch_description_source.py | bedieber/launch | 4dfe69763379e405df7a21bde536aad7e39fdd93 | [
"Apache-2.0"
] | 516 | 2015-03-20T02:22:59.000Z | 2022-03-30T12:33:33.000Z | launch/test/launch/launch_description_source/test_python_launch_description_source.py | bedieber/launch | 4dfe69763379e405df7a21bde536aad7e39fdd93 | [
"Apache-2.0"
] | 101 | 2016-01-12T16:56:54.000Z | 2022-03-09T12:35:37.000Z | # Copyright 2018 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 41.318182 | 97 | 0.779978 |
8d43cfae5bc4d8f65a0d7c4049c3873d08ddca11 | 2,008 | py | Python | Kernels.py | HamzaG737/Kmml-challenge-code | c7ae3e26a7e02e4951758c683f29c23c2ab9b3e4 | [
"MIT"
] | null | null | null | Kernels.py | HamzaG737/Kmml-challenge-code | c7ae3e26a7e02e4951758c683f29c23c2ab9b3e4 | [
"MIT"
] | null | null | null | Kernels.py | HamzaG737/Kmml-challenge-code | c7ae3e26a7e02e4951758c683f29c23c2ab9b3e4 | [
"MIT"
] | null | null | null | import numpy as np
from tqdm import tqdm
class Kernel:
"""
Class that defines different types of kernels
"""
def __init__(self, kernel="spectrum", gamma=0.1, deg=None, sigma=5.0, offset=0.0):
self.kernel = kernel
self.gamma = gamma
self.deg = deg
self.sigma = sigma
... | 24.487805 | 86 | 0.487052 |
e15c3fe270796adbf0cf971573771fae821e3d07 | 5,600 | py | Python | dask_cloudprovider/aws/tests/test_ec2.py | heiqs/dask-cloudprovider | 093af2fe8156e3e6b51c68c108f35e1d7855977d | [
"BSD-3-Clause"
] | null | null | null | dask_cloudprovider/aws/tests/test_ec2.py | heiqs/dask-cloudprovider | 093af2fe8156e3e6b51c68c108f35e1d7855977d | [
"BSD-3-Clause"
] | null | null | null | dask_cloudprovider/aws/tests/test_ec2.py | heiqs/dask-cloudprovider | 093af2fe8156e3e6b51c68c108f35e1d7855977d | [
"BSD-3-Clause"
] | null | null | null | import pytest
aiobotocore = pytest.importorskip("aiobotocore")
from dask_cloudprovider.aws.ec2 import EC2Cluster
from dask_cloudprovider.aws.helper import get_latest_ami_id
from dask.distributed import Client
from distributed.core import Status
async def skip_without_credentials():
try:
async with aiobo... | 27.317073 | 94 | 0.697143 |
4d2a70059a923a62f84cc544134dae80ddba9b24 | 650 | py | Python | aioethereum/management/__init__.py | h8is2w8/aioethereum | eb23e28068c34cda28bbef45c3f288d16936d88e | [
"MIT"
] | 16 | 2017-10-04T17:44:51.000Z | 2021-03-07T12:55:04.000Z | aioethereum/management/__init__.py | h8is2w8/aioethereum | eb23e28068c34cda28bbef45c3f288d16936d88e | [
"MIT"
] | 8 | 2017-10-04T22:53:08.000Z | 2021-01-15T18:04:41.000Z | aioethereum/management/__init__.py | h8is2w8/aioethereum | eb23e28068c34cda28bbef45c3f288d16936d88e | [
"MIT"
] | 5 | 2018-02-22T15:56:34.000Z | 2021-01-03T21:25:22.000Z | from .admin import AdminMixin
from .db import DbMixin
from .debug import DebugMixin
from .eth import EthMixin
from .miner import MinerMixin
from .net import NetMixin
from .personal import PersonalMixin
from .shh import ShhMixin
from .txpool import TxpoolMixin
from .web3 import Web3Mixin
__all__ = [
'AdminMixin',
... | 20.967742 | 74 | 0.704615 |
05f6887dfe6aab30c2a085e775c15cb296d95efa | 3,644 | py | Python | siqbal/siqbal/report/delivery_status_salesman/delivery_status_salesman.py | smehata/siqbal | 8b6a21fb63c050237593c49757065198c0e2c54a | [
"MIT"
] | 1 | 2021-08-07T12:48:02.000Z | 2021-08-07T12:48:02.000Z | siqbal/siqbal/report/delivery_status_salesman/delivery_status_salesman.py | smehata/siqbal | 8b6a21fb63c050237593c49757065198c0e2c54a | [
"MIT"
] | null | null | null | siqbal/siqbal/report/delivery_status_salesman/delivery_status_salesman.py | smehata/siqbal | 8b6a21fb63c050237593c49757065198c0e2c54a | [
"MIT"
] | 4 | 2021-01-16T06:14:58.000Z | 2022-02-07T06:36:41.000Z | # Copyright (c) 2013, RC and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
def execute(filters=None):
if not filters: filters = {}
columns = get_columns()
data = get_data(filters)
return columns, data
def get_data(filters... | 26.405797 | 128 | 0.657794 |
780e62907c55203979929948b774220550b2d613 | 11,289 | py | Python | trash/image_viewer_mod_aug29.py | Zedd1558/Image-Inpainter | c8a78443bbbc31dd790a691c58639de295575f78 | [
"MIT"
] | 6 | 2020-09-15T03:10:53.000Z | 2021-02-21T02:43:51.000Z | trash/image_viewer_mod_aug29.py | Zedd1558/Image-Inpainter | c8a78443bbbc31dd790a691c58639de295575f78 | [
"MIT"
] | 2 | 2020-09-15T13:35:24.000Z | 2020-10-20T15:22:28.000Z | trash/image_viewer_mod_aug29.py | Zedd1558/Inpainter | 6865a0396696f6307ec283ebde35d722091a5963 | [
"MIT"
] | null | null | null | """ QtImageViewer.py: PyQt image viewer widget for a QPixmap in a QGraphicsView scene with mouse zooming and panning.
"""
import os.path
try:
from PyQt5.QtCore import Qt, QRectF, pyqtSignal, QT_VERSION_STR, QPoint
from PyQt5.QtGui import QImage, QPixmap, QPainterPath, QPen, QPainter
from PyQt5.QtWidgets im... | 41.351648 | 120 | 0.618921 |
71d693f61b624df5fe568391e0c680d9c46b0192 | 1,778 | py | Python | wisps/simulations/combine_templates.py | caganze/wisps | 6572201f94a6af6d1c0a306f2f447215d4330bd7 | [
"MIT"
] | null | null | null | wisps/simulations/combine_templates.py | caganze/wisps | 6572201f94a6af6d1c0a306f2f447215d4330bd7 | [
"MIT"
] | 7 | 2021-02-02T21:51:56.000Z | 2022-01-13T00:57:45.000Z | wisps/simulations/combine_templates.py | caganze/wisps | 6572201f94a6af6d1c0a306f2f447215d4330bd7 | [
"MIT"
] | null | null | null | ##purpose: combines object spectral type and then reclassify them
##scaled to their absolute magnitudes
import splat
import wisps
import pandas as pd
import numpy as np
from itertools import combinations
from tqdm import tqdm
import splat.empirical as spe
from concurrent.futures import ThreadPoolExecutor, wait , ALL... | 26.939394 | 101 | 0.705849 |
ad5a43a70eccb7bd46919eeba3e3e27f5ba35ac1 | 1,083 | py | Python | pyvisdk/do/vim_esx_cl_iiscsiadapterauthchapget_adapter_chap_auth.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null | pyvisdk/do/vim_esx_cl_iiscsiadapterauthchapget_adapter_chap_auth.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null | pyvisdk/do/vim_esx_cl_iiscsiadapterauthchapget_adapter_chap_auth.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null |
import logging
from pyvisdk.exceptions import InvalidArgumentError
# This module is NOT auto-generated
# Inspired by decompiled Java classes from vCenter's internalvim25stubs.jar
# Unless states otherside, the methods and attributes were not used by esxcli,
# and thus not tested
log = logging.getLogger(__name__)
de... | 34.935484 | 124 | 0.690674 |
909ad63681f0a3344e401120bec3de6a3e879d5e | 1,914 | py | Python | reveries/scripts/deadline_extract.py | davidlatwe/reveries-config | 4a282dd64a32a9b87bd1a070759b6425ff785d68 | [
"MIT"
] | 3 | 2020-04-01T10:51:17.000Z | 2021-08-05T18:35:23.000Z | reveries/scripts/deadline_extract.py | davidlatwe/reveries-config | 4a282dd64a32a9b87bd1a070759b6425ff785d68 | [
"MIT"
] | null | null | null | reveries/scripts/deadline_extract.py | davidlatwe/reveries-config | 4a282dd64a32a9b87bd1a070759b6425ff785d68 | [
"MIT"
] | 1 | 2020-07-05T12:06:30.000Z | 2020-07-05T12:06:30.000Z |
import os
import sys
import logging
import json
import pyblish.api
import pyblish.lib
def get_plugin(classname):
# Find extractor plugin
Plugin = None
for P in pyblish.api.discover():
if P.__name__ == classname:
Plugin = P
break
assert Plugin, "Pyblish plugin not foun... | 25.52 | 75 | 0.577325 |
50b430207f97745d4db9a4df6556019facd73fad | 966 | py | Python | Invisibility Cloak/Cloak.py | Achyut-Saxena/OpenCV-Projects | d1c9bee943c62fa563555a6b4eb13926b81461d6 | [
"MIT"
] | null | null | null | Invisibility Cloak/Cloak.py | Achyut-Saxena/OpenCV-Projects | d1c9bee943c62fa563555a6b4eb13926b81461d6 | [
"MIT"
] | 1 | 2021-07-16T04:16:21.000Z | 2021-07-16T04:16:51.000Z | Invisibility Cloak/Cloak.py | Achyut-Saxena/OpenCV-Projects | d1c9bee943c62fa563555a6b4eb13926b81461d6 | [
"MIT"
] | null | null | null | import time
import cv2
import numpy as np
cap = cv2.VideoCapture(0, cv2.CAP_DSHOW)
print("Invisibility cloak starts working in:", end="")
for i in range(5):
print(i+1, end=" ")
time.sleep(i)
background = 0
for _ in range(30):
ret, background = cap.read()
background = np.flip(background, axis=1)
while Tru... | 27.6 | 62 | 0.666667 |
def4292d1ddcccdc68b5a09926601aa090feff4c | 5,308 | py | Python | taggit/models.py | makaimc/pfisdi | 45e897b374d50e2f5385f15cbf318da0e17900f7 | [
"MIT"
] | 2 | 2015-01-05T21:09:24.000Z | 2015-07-31T16:52:38.000Z | taggit/models.py | makaimc/pfisdi | 45e897b374d50e2f5385f15cbf318da0e17900f7 | [
"MIT"
] | null | null | null | taggit/models.py | makaimc/pfisdi | 45e897b374d50e2f5385f15cbf318da0e17900f7 | [
"MIT"
] | null | null | null | import django
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.generic import GenericForeignKey
from django.db import models, IntegrityError, transaction
from django.template.defaultfilters import slugify as default_slugify
from django.utils.translation import ugettext_lazy as... | 31.784431 | 82 | 0.602675 |
e6a28163993f523934acac87efaaa3a72c0c3c24 | 6,444 | py | Python | inference_realesrgan.py | Gyudori/Real-ESRGAN | 388a477da5c2864faaba6680e926ddf16bc122eb | [
"BSD-3-Clause"
] | null | null | null | inference_realesrgan.py | Gyudori/Real-ESRGAN | 388a477da5c2864faaba6680e926ddf16bc122eb | [
"BSD-3-Clause"
] | null | null | null | inference_realesrgan.py | Gyudori/Real-ESRGAN | 388a477da5c2864faaba6680e926ddf16bc122eb | [
"BSD-3-Clause"
] | null | null | null | import argparse
import cv2
import glob
import os
import time
from basicsr.archs.rrdbnet_arch import RRDBNet
from realesrgan import RealESRGANer
from realesrgan.archs.srvgg_arch import SRVGGNetCompact
def print_elapsed_time(print_messeage, start_time):
end_time = time.time()
hours, rem = divmod(end_time-start_... | 42.675497 | 115 | 0.63563 |
6c902d5fb8e7725b81d9433a9cc0afe42f4ab855 | 3,230 | py | Python | PaddleNLP/dialogue_system/auto_dialogue_evaluation/inference_model.py | lishiyu93/models | 5a41865d3b2a597ba703f0c57c8520f79ff74656 | [
"Apache-2.0"
] | 1 | 2020-05-19T01:24:17.000Z | 2020-05-19T01:24:17.000Z | PaddleNLP/dialogue_system/auto_dialogue_evaluation/inference_model.py | lishiyu93/models | 5a41865d3b2a597ba703f0c57c8520f79ff74656 | [
"Apache-2.0"
] | null | null | null | PaddleNLP/dialogue_system/auto_dialogue_evaluation/inference_model.py | lishiyu93/models | 5a41865d3b2a597ba703f0c57c8520f79ff74656 | [
"Apache-2.0"
] | 1 | 2018-06-27T10:14:19.000Z | 2018-06-27T10:14:19.000Z | # Copyright (c) 2019 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 ... | 31.980198 | 165 | 0.654489 |
c369232fa4a8ce765945f77d5e581c0d73a345ea | 5,255 | py | Python | File Inclusion/phpinfolfi.py | hartoyob/PayloadsAllTheThings | 12ee5277636612865a12dbbb83175f157e1423f1 | [
"MIT"
] | 38,247 | 2016-11-22T14:35:27.000Z | 2022-03-31T21:17:44.000Z | File Inclusion/phpinfolfi.py | victorbonato/PayloadsAllTheThings | 210a2b308158e810b6b152e145947e0bd2a81f94 | [
"MIT"
] | 143 | 2017-02-21T06:10:43.000Z | 2022-03-24T21:57:12.000Z | File Inclusion/phpinfolfi.py | victorbonato/PayloadsAllTheThings | 210a2b308158e810b6b152e145947e0bd2a81f94 | [
"MIT"
] | 10,479 | 2017-01-12T14:34:55.000Z | 2022-03-31T23:07:52.000Z | #!/usr/bin/python
# https://www.insomniasec.com/downloads/publications/LFI%20With%20PHPInfo%20Assistance.pdf
# The following line is not required but supposedly optimizes code.
# However, this breaks on some Python 2 installations, where the future module version installed is > 0.16. This can be a pain to revert.
# ... | 26.675127 | 138 | 0.552807 |
b593c64a071b6643abda502a3cab49619e9d1eb5 | 587 | py | Python | ampel/model/time/UnixTimeModel.py | mafn/Ampel-core | 744acbf36f0a2ceae7230ceab1350236c1501b57 | [
"BSD-3-Clause"
] | null | null | null | ampel/model/time/UnixTimeModel.py | mafn/Ampel-core | 744acbf36f0a2ceae7230ceab1350236c1501b57 | [
"BSD-3-Clause"
] | null | null | null | ampel/model/time/UnixTimeModel.py | mafn/Ampel-core | 744acbf36f0a2ceae7230ceab1350236c1501b57 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# File: Ampel-core/ampel/model/time/UnixTimeModel.py
# License: BSD-3-Clause
# Author: valery brinnel <firstname.lastname@gmail.com>
# Date: 29.09.2018
# Last Modified Date: 06.06.2020
# Last Modified By: valery bri... | 27.952381 | 68 | 0.674617 |
405dd67a91afef42bacc4e2ed5fae4884210c3c9 | 5,824 | py | Python | src/models/circuit.py | flyingbanana1024102/transmission-line-simulator | 101b771702791e29f6a1ce1bbcdac1de2ed82982 | [
"MIT"
] | null | null | null | src/models/circuit.py | flyingbanana1024102/transmission-line-simulator | 101b771702791e29f6a1ce1bbcdac1de2ed82982 | [
"MIT"
] | 4 | 2018-09-02T23:07:28.000Z | 2018-09-12T05:26:59.000Z | src/models/circuit.py | flyingbanana1024102/transmission-line-simulator | 101b771702791e29f6a1ce1bbcdac1de2ed82982 | [
"MIT"
] | null | null | null | #
# Transmission Line Simulator
#
# Author(s): Jiacong Xu
# Created: Jul-3-2017
#
from circuitelement import CircuitElement
from powersource import PowerSource
from resistor import Resistor
from oscilloscope import Oscilloscope
from util.constants import *
from wire import Wire
class Circuit(object):
"""
An ... | 25.432314 | 97 | 0.504293 |
77e62efaeab063a77fc142dab0ba15248b847f42 | 3,280 | py | Python | plot_sensor_csv.py | weightedEights/plot_sensor_csv | d84efec649464af409ef9f8a8c635aa06e00f449 | [
"MIT"
] | null | null | null | plot_sensor_csv.py | weightedEights/plot_sensor_csv | d84efec649464af409ef9f8a8c635aa06e00f449 | [
"MIT"
] | null | null | null | plot_sensor_csv.py | weightedEights/plot_sensor_csv | d84efec649464af409ef9f8a8c635aa06e00f449 | [
"MIT"
] | null | null | null | import os
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.style as pltstyle
from bokeh.plotting import figure, output_file, show
from bokeh.models import HoverTool
from bokeh.themes import built_in_themes
from bokeh.io import curdoc
dat_files_to_plot = ["temps_20190817.txt"]
def main():
#... | 27.333333 | 103 | 0.630488 |
963a8c2a461630b959b31ef091946a011cc71411 | 586 | py | Python | src/powergslb/server/http/handler/abstract.py | fyanuar/powergslb | 7dae75fd89017ef77385d15fde8c931b8436db92 | [
"MIT"
] | 81 | 2016-01-21T12:02:39.000Z | 2022-02-11T13:07:07.000Z | src/powergslb/server/http/handler/abstract.py | fyanuar/powergslb | 7dae75fd89017ef77385d15fde8c931b8436db92 | [
"MIT"
] | 24 | 2017-03-05T00:12:49.000Z | 2022-01-18T12:34:32.000Z | src/powergslb/server/http/handler/abstract.py | fyanuar/powergslb | 7dae75fd89017ef77385d15fde8c931b8436db92 | [
"MIT"
] | 28 | 2017-04-28T17:16:29.000Z | 2022-02-16T04:49:23.000Z | import abc
__all__ = ['AbstractContentHandler']
class AbstractContentHandler(object):
"""
AbstractContentHandler class
"""
__metaclass__ = abc.ABCMeta
def __init__(self, request_handler):
self.body = request_handler.body
self.database = request_handler.database
self.dirs ... | 24.416667 | 50 | 0.6843 |
6198a3840b6e88f01c5e65bfeea62ad9db522569 | 3,919 | py | Python | assets/check_fingerprint_vcf.py | UMCUGenetics/DxNextflowMIP | ab4c3d006d38577a020ad848224f8ab208e83d79 | [
"MIT"
] | null | null | null | assets/check_fingerprint_vcf.py | UMCUGenetics/DxNextflowMIP | ab4c3d006d38577a020ad848224f8ab208e83d79 | [
"MIT"
] | null | null | null | assets/check_fingerprint_vcf.py | UMCUGenetics/DxNextflowMIP | ab4c3d006d38577a020ad848224f8ab208e83d79 | [
"MIT"
] | null | null | null | import argparse
import os
import shutil
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Check fingerprint vcf files.')
parser.add_argument('fingerprint_vcf_files', type=argparse.FileType('r'), nargs='*', help='Fingerprint VCF')
arguments = parser.parse_args()
disapproved_fold... | 45.045977 | 155 | 0.546313 |
312255cffc122fbff5083163ad6414b714bca7f3 | 20,066 | gyp | Python | brightray/brightray.gyp | frantic/electron | 4ebe71655b1575f985ddde5760f8f5cde8f03f0d | [
"MIT"
] | 2 | 2018-06-23T22:04:12.000Z | 2018-06-28T08:59:52.000Z | brightray/brightray.gyp | frantic/electron | 4ebe71655b1575f985ddde5760f8f5cde8f03f0d | [
"MIT"
] | null | null | null | brightray/brightray.gyp | frantic/electron | 4ebe71655b1575f985ddde5760f8f5cde8f03f0d | [
"MIT"
] | 1 | 2018-10-05T17:29:23.000Z | 2018-10-05T17:29:23.000Z | {
'variables': {
# The libraries brightray will be compiled to.
'linux_system_libraries': 'gtk+-3.0 atk-bridge-2.0 dbus-1 x11 x11-xcb xcb xi xcursor xdamage xrandr xcomposite xext xfixes xrender xtst xscrnsaver gconf-2.0 gmodule-2.0 nss',
'conditions': [
['target_arch=="mips64el"', {
'linux_... | 44.295806 | 178 | 0.490531 |
1c95c05af99855151e97f19bd06dad4d38303553 | 409 | py | Python | rate_my_landlord/rate_my_landlord/asgi.py | Antsthebul/ratemylandlord | 729bd3307ebb3288df2d8173b10d41f57265bdae | [
"Apache-2.0"
] | 1 | 2021-10-10T00:21:15.000Z | 2021-10-10T00:21:15.000Z | rate_my_landlord/rate_my_landlord/asgi.py | Antsthebul/ratemylandlord | 729bd3307ebb3288df2d8173b10d41f57265bdae | [
"Apache-2.0"
] | 19 | 2021-10-04T05:01:05.000Z | 2021-12-06T23:39:00.000Z | rate_my_landlord/rate_my_landlord/asgi.py | Antsthebul/ratemylandlord | 729bd3307ebb3288df2d8173b10d41f57265bdae | [
"Apache-2.0"
] | 4 | 2021-11-28T15:34:36.000Z | 2021-12-03T23:56:59.000Z | """
ASGI config for rate_my_landlord project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJA... | 24.058824 | 78 | 0.794621 |
15950e6e93266782283cd21dcc0e6af671a1bde2 | 5,472 | py | Python | products/views.py | sakthipriya-07/BuildingConstructionMaterialsSupply | e4b32d97eb6e574e78b955a03a0717bc7b5d13d4 | [
"MIT"
] | null | null | null | products/views.py | sakthipriya-07/BuildingConstructionMaterialsSupply | e4b32d97eb6e574e78b955a03a0717bc7b5d13d4 | [
"MIT"
] | null | null | null | products/views.py | sakthipriya-07/BuildingConstructionMaterialsSupply | e4b32d97eb6e574e78b955a03a0717bc7b5d13d4 | [
"MIT"
] | null | null | null | from django.contrib.admin.views.decorators import staff_member_required
from django.shortcuts import render, get_object_or_404, redirect
from django.utils import timezone
from .filter import ProductFilter
from .models import Category, Product
from users.models import Customer, User
from orders.models import Order
from... | 31.813953 | 89 | 0.64693 |
2fe4b6ce52dc3889955b82d99b7a0a407ef5fd32 | 765 | py | Python | doc/gallery-src/framework/run_isotxs2_matrix.py | ZanderUF/armi | c55ebe4d77821d3357ddd3326478ffaf44962c89 | [
"Apache-2.0"
] | 1 | 2022-01-23T06:09:50.000Z | 2022-01-23T06:09:50.000Z | doc/gallery-src/framework/run_isotxs2_matrix.py | ZanderUF/armi | c55ebe4d77821d3357ddd3326478ffaf44962c89 | [
"Apache-2.0"
] | null | null | null | doc/gallery-src/framework/run_isotxs2_matrix.py | ZanderUF/armi | c55ebe4d77821d3357ddd3326478ffaf44962c89 | [
"Apache-2.0"
] | 1 | 2020-08-26T09:02:06.000Z | 2020-08-26T09:02:06.000Z | """
Plotting a multi-group scatter matrix
=====================================
Here we plot scatter matrices from an ISOTXS microscopic cross section library.
We plot the inelastic scatter cross section of U235 as well as the (n,2n) source
matrix.
See Also: :py:mod:`ISOTXS <armi.nuclearDataIO.isotxs>` format.
"""
... | 24.677419 | 80 | 0.747712 |
508585309fe1e22ce027e5d9067f2eb7247ed665 | 2,036 | py | Python | aleph/tests/test_view_util.py | Rosencrantz/aleph | 47ac45fa72607e1ab16c7c30690013a7d00be116 | [
"MIT"
] | 1,213 | 2017-03-15T08:10:52.000Z | 2022-03-29T13:57:44.000Z | aleph/tests/test_view_util.py | Rosencrantz/aleph | 47ac45fa72607e1ab16c7c30690013a7d00be116 | [
"MIT"
] | 1,374 | 2017-03-14T18:23:10.000Z | 2022-03-31T18:42:20.000Z | aleph/tests/test_view_util.py | Rosencrantz/aleph | 47ac45fa72607e1ab16c7c30690013a7d00be116 | [
"MIT"
] | 217 | 2017-03-17T12:04:22.000Z | 2022-03-20T11:17:16.000Z | from lxml.html import document_fromstring
from aleph.logic.html import sanitize_html
from aleph.views.util import get_url_path
from aleph.tests.util import TestCase
class ViewUtilTest(TestCase):
def setUp(self):
super(ViewUtilTest, self).setUp()
def test_get_url_pat(self):
self.assertEqual("... | 58.171429 | 596 | 0.644401 |
0f49c2ca12b45c7d573c187e9cd7c1eb781d9664 | 1,794 | py | Python | tests/json_tests.py | Caflo/sniffy | 35da1aa5c6de6ce1cb64d66125ff8dabdd03a928 | [
"MIT"
] | null | null | null | tests/json_tests.py | Caflo/sniffy | 35da1aa5c6de6ce1cb64d66125ff8dabdd03a928 | [
"MIT"
] | null | null | null | tests/json_tests.py | Caflo/sniffy | 35da1aa5c6de6ce1cb64d66125ff8dabdd03a928 | [
"MIT"
] | null | null | null | import os
import logging
import unittest
import subprocess
from src.log.log import logger
from unittest import TestCase
from src.controller.sniffer_ctrl import RequestHandler
class TestJson(TestCase):
def setUp(self) -> None:
print("\n\n----------------- SETUP -----------------")
print("Getting sh... | 39 | 112 | 0.624861 |
4b327c10835063ec43b0fedd0c7335d15ca2ac05 | 7,157 | py | Python | examples/CooperativeSearch/psaltlib/LMCP/py/afrl/impact/AngledAreaSearchTask.py | GaloisInc/salty | f410659b3399ad7c527513e67b06dff0332d823e | [
"BSD-3-Clause"
] | 13 | 2017-02-15T21:56:46.000Z | 2022-03-23T12:59:26.000Z | examples/VIP-Escort/lmcp/py/afrl/impact/AngledAreaSearchTask.py | GaloisInc/salty | f410659b3399ad7c527513e67b06dff0332d823e | [
"BSD-3-Clause"
] | 17 | 2016-07-21T10:47:23.000Z | 2020-08-07T13:26:21.000Z | examples/CooperativeSearch/psaltlib/LMCP/py/afrl/impact/AngledAreaSearchTask.py | GaloisInc/salty | f410659b3399ad7c527513e67b06dff0332d823e | [
"BSD-3-Clause"
] | 2 | 2019-06-11T11:59:40.000Z | 2022-02-09T12:48:39.000Z | #! /usr/bin/python
import sys, struct
import xml.dom.minidom
from lmcp import LMCPObject
## ===============================================================================
## Authors: AFRL/RQQA
## Organization: Air Force Research Laboratory, Aerospace Systems Directorate, Power and Control Division
##
## Copyright (... | 35.606965 | 117 | 0.578175 |
43baa4e61c524ffe1ef7e3086ac851b30eb6e771 | 2,989 | py | Python | setup.py | hartikainen/trfl | e633edbd9d326b8bebc7c7c7d53f37118b48a440 | [
"Apache-2.0"
] | null | null | null | setup.py | hartikainen/trfl | e633edbd9d326b8bebc7c7c7d53f37118b48a440 | [
"Apache-2.0"
] | null | null | null | setup.py | hartikainen/trfl | e633edbd9d326b8bebc7c7c7d53f37118b48a440 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The trfl 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 law... | 33.965909 | 78 | 0.668451 |
264a7b656c8231bb102da5df21535c0966dbb1a9 | 416 | py | Python | setup.py | wuyang0928/testrepo2 | e31c6b4aa701e162886c99f6db4b2928c26c99fe | [
"MIT"
] | null | null | null | setup.py | wuyang0928/testrepo2 | e31c6b4aa701e162886c99f6db4b2928c26c99fe | [
"MIT"
] | 1 | 2017-12-01T04:58:29.000Z | 2017-12-01T04:58:29.000Z | setup.py | wuyang0928/testrepo2 | e31c6b4aa701e162886c99f6db4b2928c26c99fe | [
"MIT"
] | 63 | 2017-11-27T06:46:37.000Z | 2020-10-14T14:23:29.000Z | from setuptools import setup, find_packages
setup(name='WorkshopExample',
version='0.0.1',
description='Random example project for coding workshop',
url='http://github.com/Samreay/WorkshopExample',
author='Samuel Hinton',
author_email='samuelreay@gmail.com',
license='MIT',
ins... | 32 | 63 | 0.665865 |
d325dfe870886610f6405862e47b2904b64c917a | 369 | py | Python | 1.py | juandarr/ProjectEuler | 951705ac62f550d7fbecdc3f35ab8c38b53b9225 | [
"MIT"
] | null | null | null | 1.py | juandarr/ProjectEuler | 951705ac62f550d7fbecdc3f35ab8c38b53b9225 | [
"MIT"
] | null | null | null | 1.py | juandarr/ProjectEuler | 951705ac62f550d7fbecdc3f35ab8c38b53b9225 | [
"MIT"
] | null | null | null | """
Adds the multiples of 3 or 5 below a certain number
Author: Juan Rios
"""
def multiple_of_3_or_5(number):
sum = 0
for i in range(1,number):
if (i%3==0 or i%5==0):
sum += i
return sum
if __name__ == "__main__":
number = 1000
print('The sum of multiples of 3 or 5 below {0} is... | 24.6 | 103 | 0.617886 |
8b5f9cf0bc04565ea1d03c8d51c47f29c9b8b54c | 27,138 | py | Python | cranelift-codegen/meta-python/isa/x86/encodings.py | benschau/cranelift | be02e945613270d17a316a23a58e0791d5712cee | [
"Apache-2.0"
] | null | null | null | cranelift-codegen/meta-python/isa/x86/encodings.py | benschau/cranelift | be02e945613270d17a316a23a58e0791d5712cee | [
"Apache-2.0"
] | null | null | null | cranelift-codegen/meta-python/isa/x86/encodings.py | benschau/cranelift | be02e945613270d17a316a23a58e0791d5712cee | [
"Apache-2.0"
] | null | null | null | """
x86 Encodings.
"""
from __future__ import absolute_import
from cdsl.predicates import IsZero32BitFloat, IsZero64BitFloat
from cdsl.predicates import IsUnsignedInt
from base.predicates import IsColocatedFunc, IsColocatedData, LengthEquals
from base import instructions as base
from base import types
from base.formats... | 36.135819 | 79 | 0.712027 |
50a31a1c09aa002260757b7c74d5c46a730e8184 | 1,337 | py | Python | conversations/handlers/add_task.py | dattatreya303/round_robin_tasker | 74b031322ef1ca59072486c5c7d0d98e59bc62c3 | [
"MIT"
] | null | null | null | conversations/handlers/add_task.py | dattatreya303/round_robin_tasker | 74b031322ef1ca59072486c5c7d0d98e59bc62c3 | [
"MIT"
] | 4 | 2020-08-03T15:50:48.000Z | 2020-11-01T06:05:38.000Z | conversations/handlers/add_task.py | dattatreya303/round_robin_tasker | 74b031322ef1ca59072486c5c7d0d98e59bc62c3 | [
"MIT"
] | null | null | null | from telegram.ext import ConversationHandler, CommandHandler, MessageHandler, Filters
from conversations.callbacks.add_task import add_task_conv_start, add_task_conv_ask_name, \
add_task_conv_ask_participants
from conversations.commands import MainCommands
from conversations.common import TIMEOUT_DURATION
from con... | 44.566667 | 116 | 0.802543 |
2cb5c65df4cfca25feb4e40871ffdf9da12ca65d | 10,805 | py | Python | cloudkitty/rating/hash/db/sqlalchemy/models.py | sreenathmenon/cloudkitty-0.5.1d39 | c26b8c9ad9e40ab17cab54378117efaae7af5eff | [
"Apache-2.0"
] | null | null | null | cloudkitty/rating/hash/db/sqlalchemy/models.py | sreenathmenon/cloudkitty-0.5.1d39 | c26b8c9ad9e40ab17cab54378117efaae7af5eff | [
"Apache-2.0"
] | null | null | null | cloudkitty/rating/hash/db/sqlalchemy/models.py | sreenathmenon/cloudkitty-0.5.1d39 | c26b8c9ad9e40ab17cab54378117efaae7af5eff | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2014 Objectif Libre
#
# 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 ... | 39.00722 | 79 | 0.490514 |
a0754bd03e8968964e19d501ab68a866365e9d03 | 8,577 | py | Python | src/python/driver.py | kmu-bigdata/lambda-refarch-mapreduce | 74eb74aefcb929b2a7542280176b42c947f401bd | [
"MIT-0"
] | 1 | 2020-11-05T10:00:15.000Z | 2020-11-05T10:00:15.000Z | src/python/driver.py | manchann/lambda-refarch-mapreduce | 74eb74aefcb929b2a7542280176b42c947f401bd | [
"MIT-0"
] | null | null | null | src/python/driver.py | manchann/lambda-refarch-mapreduce | 74eb74aefcb929b2a7542280176b42c947f401bd | [
"MIT-0"
] | 1 | 2020-11-11T02:16:52.000Z | 2020-11-11T02:16:52.000Z | #-*- coding: utf-8 -*-
'''
Driver to start BigLambda Job
* Copyright 2016, Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Amazon Software License (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* htt... | 32.366038 | 111 | 0.704792 |
75c763241e9151f3dcb2863eac573651f186b3ab | 6,116 | py | Python | AutotestWebD/apps/ui_main/views/page_object.py | yangjourney/sosotest | 2e88099a829749910ca325253c9b1a2e368d21a0 | [
"MIT"
] | 422 | 2019-08-18T05:04:20.000Z | 2022-03-31T06:49:19.000Z | AutotestWebD/apps/ui_main/views/page_object.py | LinSongJian1985/sosotest | 091863dee531b5726650bb63efd6f169267cbeb4 | [
"MIT"
] | 10 | 2019-10-24T09:55:38.000Z | 2021-09-29T17:28:43.000Z | AutotestWebD/apps/ui_main/views/page_object.py | LinSongJian1985/sosotest | 091863dee531b5726650bb63efd6f169267cbeb4 | [
"MIT"
] | 202 | 2019-08-18T05:04:27.000Z | 2022-03-30T05:57:18.000Z | from apps.common.func.CommonFunc import *
from apps.common.func.LanguageFunc import *
from django.shortcuts import render, HttpResponse
from urllib import parse
from apps.common.config import commonWebConfig
from apps.common.func.WebFunc import *
from apps.ui_globals.services.global_textService import global_textServic... | 37.292683 | 150 | 0.65206 |
f2daa1601668f341063ec5a544ecc640ce8a4664 | 2,100 | py | Python | aliyun-python-sdk-ecs/aliyunsdkecs/request/v20140526/CancelAutoSnapshotPolicyRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 1,001 | 2015-07-24T01:32:41.000Z | 2022-03-25T01:28:18.000Z | aliyun-python-sdk-ecs/aliyunsdkecs/request/v20140526/CancelAutoSnapshotPolicyRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 363 | 2015-10-20T03:15:00.000Z | 2022-03-08T12:26:19.000Z | aliyun-python-sdk-ecs/aliyunsdkecs/request/v20140526/CancelAutoSnapshotPolicyRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 682 | 2015-09-22T07:19:02.000Z | 2022-03-22T09:51:46.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... | 38.888889 | 83 | 0.765714 |
c2df9bcff3455b55de162e28eebf3760322e2b67 | 412 | py | Python | uscis_service/src/constants.py | FrenchCommando/uscis-status | 34b9a5db38130d595d3c3889a764e7c134d2287b | [
"MIT"
] | 4 | 2020-05-18T14:45:20.000Z | 2021-08-24T19:43:17.000Z | uscis_service/src/constants.py | FrenchCommando/uscis-status | 34b9a5db38130d595d3c3889a764e7c134d2287b | [
"MIT"
] | null | null | null | uscis_service/src/constants.py | FrenchCommando/uscis-status | 34b9a5db38130d595d3c3889a764e7c134d2287b | [
"MIT"
] | 1 | 2020-05-18T01:26:19.000Z | 2020-05-18T01:26:19.000Z | import os
IS_DOCKER = os.environ.get('AM_I_IN_A_DOCKER_CONTAINER', False)
uscis_database = "uscis"
uscis_table_name = "uscis_table"
error_table_name = "error_table"
host = "db" if IS_DOCKER else "localhost"
host_uscis_service = "uscis_service" if IS_DOCKER else "localhost"
pg_port_number = 5432 # port of pg servic... | 25.75 | 66 | 0.771845 |
de4821f5843be5f3890a4d07363013fa5996c916 | 1,682 | py | Python | config/urls.py | eziolevine/openstage | 25136f0b8d8440eddcd50547aad6c117b8c85393 | [
"BSD-3-Clause"
] | null | null | null | config/urls.py | eziolevine/openstage | 25136f0b8d8440eddcd50547aad6c117b8c85393 | [
"BSD-3-Clause"
] | null | null | null | config/urls.py | eziolevine/openstage | 25136f0b8d8440eddcd50547aad6c117b8c85393 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.views.generic import TemplateView
from django.views import defaults as default_views
from op... | 43.128205 | 109 | 0.712842 |
f45ddd5ef20bbe0e8194451a1317e7f5f86235a5 | 437 | py | Python | quadratic.py | DariaMagarshak/python_training | 03c2c5c879db6c65ed3ca8453b8b2c0c8b033dc1 | [
"Apache-2.0"
] | null | null | null | quadratic.py | DariaMagarshak/python_training | 03c2c5c879db6c65ed3ca8453b8b2c0c8b033dc1 | [
"Apache-2.0"
] | null | null | null | quadratic.py | DariaMagarshak/python_training | 03c2c5c879db6c65ed3ca8453b8b2c0c8b033dc1 | [
"Apache-2.0"
] | null | null | null | from math import sqrt
def solve(a, b, c):
d = b*b - 4*a*c
if d < 0:
print("No solutions")
elif d == 0:
x = -b / (2*a)
print("One solution" + str(x))
elif d > 0:
x1 = (-b + sqrt(d)) / (2*a)
x2 = (-b - sqrt(d)) / (2 * a)
print("Two solut... | 21.85 | 63 | 0.405034 |
2b1b9578bd49eb0a7582ca410606520ea73e767a | 3,287 | py | Python | python/example_code/set-routetb-multilb.py | nifcloud/nifcloud-sample | 336773d8f0a2fb842fc20bb33da9ba83c5ed4457 | [
"Apache-2.0"
] | null | null | null | python/example_code/set-routetb-multilb.py | nifcloud/nifcloud-sample | 336773d8f0a2fb842fc20bb33da9ba83c5ed4457 | [
"Apache-2.0"
] | 3 | 2022-01-21T14:07:01.000Z | 2022-01-24T02:11:05.000Z | python/example_code/set-routetb-multilb.py | nifcloud/nifcloud-sample | 336773d8f0a2fb842fc20bb33da9ba83c5ed4457 | [
"Apache-2.0"
] | null | null | null | from nifcloud import session
import sys
# --- define --------
# -- MULTILB Name -------
MULTILB_NAME = "web"
MULTILB_WAIT_PORT = 8080
MULTILB_TARGET_PORT = 80
MULTILB_PROTOCOL = 'HTTP'
# --------------------
# -- Routing Info --------
TARGET_CIDER = '10.2.3.0/24'
TARGET_NEXTHOP = '10.4.4.1'
# --------------------
# --... | 30.719626 | 121 | 0.485549 |
680e62c9c5000846401236876454cb6012fe83fc | 587 | py | Python | helpers/admins.py | Goswamiroyal/Miss_fruity_music- | b172b6854acfcb828ac2928b7c9b019c91da58b1 | [
"MIT"
] | 23 | 2021-09-14T11:36:24.000Z | 2022-03-22T09:55:05.000Z | helpers/admins.py | Goswamiroyal/Miss_fruity_music- | b172b6854acfcb828ac2928b7c9b019c91da58b1 | [
"MIT"
] | null | null | null | helpers/admins.py | Goswamiroyal/Miss_fruity_music- | b172b6854acfcb828ac2928b7c9b019c91da58b1 | [
"MIT"
] | 54 | 2021-09-14T16:10:35.000Z | 2022-03-25T19:21:11.000Z | import cache.admins
from typing import List
from pyrogram.types import Chat
from cache.admins import get as gett
from cache.admins import set
async def get_administrators(chat: Chat) -> List[int]:
get = gett(chat.id)
if get:
return get
else:
administrators = await chat.get_members(filter... | 24.458333 | 72 | 0.678024 |
29279cad67279ea941da539d8cdeec8d03fb403f | 1,677 | py | Python | Base/BaseTempFolder.py | SamanFekri/BookRecommendation | 07dfa875154af39546cb263d4407339ce26d47e8 | [
"MIT"
] | null | null | null | Base/BaseTempFolder.py | SamanFekri/BookRecommendation | 07dfa875154af39546cb263d4407339ce26d47e8 | [
"MIT"
] | null | null | null | Base/BaseTempFolder.py | SamanFekri/BookRecommendation | 07dfa875154af39546cb263d4407339ce26d47e8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on 19/06/2019
@author: Maurizio Ferrari Dacrema
"""
from Base.Recommender_utils import get_unique_temp_folder
import os, shutil
class BaseTempFolder(object):
def __init__(self):
super(BaseTempFolder, self).__init__()
self.DEFAULT_TEMP_... | 32.25 | 125 | 0.692904 |
5b24933966691e5d41acff47087e140eff99ee11 | 8,519 | py | Python | Sketches/RJL/HTTP/IcecastClient.py | sparkslabs/kamaelia_orig | 24b5f855a63421a1f7c6c7a35a7f4629ed955316 | [
"Apache-2.0"
] | 12 | 2015-10-20T10:22:01.000Z | 2021-07-19T10:09:44.000Z | Sketches/RJL/HTTP/IcecastClient.py | sparkslabs/kamaelia_orig | 24b5f855a63421a1f7c6c7a35a7f4629ed955316 | [
"Apache-2.0"
] | 2 | 2015-10-20T10:22:55.000Z | 2017-02-13T11:05:25.000Z | Sketches/RJL/HTTP/IcecastClient.py | sparkslabs/kamaelia_orig | 24b5f855a63421a1f7c6c7a35a7f4629ed955316 | [
"Apache-2.0"
] | 6 | 2015-03-09T12:51:59.000Z | 2020-03-01T13:06:21.000Z | # -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License, Version 2.0 (the "Lice... | 35.202479 | 138 | 0.570959 |
0533cd3c4e8dbeae09e721a2a69d1a05cd17fede | 24,975 | py | Python | parlai/tasks/msc/agents.py | skywalker023/ParlAI | 70ee4a2c63008774fc9e66a8392847554920a14d | [
"MIT"
] | null | null | null | parlai/tasks/msc/agents.py | skywalker023/ParlAI | 70ee4a2c63008774fc9e66a8392847554920a14d | [
"MIT"
] | 2 | 2022-01-13T03:54:49.000Z | 2022-03-12T01:00:29.000Z | parlai/tasks/msc/agents.py | skywalker023/ParlAI | 70ee4a2c63008774fc9e66a8392847554920a14d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from parlai.core.teachers import DialogTeacher
from parlai.utils.io import PathManager
from parlai.core.opt import Opt
f... | 40.347334 | 153 | 0.552312 |
601099085405113a5b4a6c114a5a5d070e63e06f | 2,790 | py | Python | tests/test_client.py | ihorizonUK/workos-python | 80ec96d9c4ed3f2539946a19ad9c9b59ac6ee023 | [
"MIT"
] | 13 | 2020-03-18T20:38:32.000Z | 2022-03-02T20:23:42.000Z | tests/test_client.py | ihorizonUK/workos-python | 80ec96d9c4ed3f2539946a19ad9c9b59ac6ee023 | [
"MIT"
] | 71 | 2020-02-27T03:53:40.000Z | 2022-03-11T16:54:14.000Z | tests/test_client.py | ihorizonUK/workos-python | 80ec96d9c4ed3f2539946a19ad9c9b59ac6ee023 | [
"MIT"
] | 5 | 2020-10-29T22:38:41.000Z | 2022-02-20T21:12:58.000Z | import pytest
from workos import client
from workos.exceptions import ConfigurationException
class TestClient(object):
@pytest.fixture(autouse=True)
def setup(self):
client._audit_trail = None
client._directory_sync = None
client._organizations = None
client._passwordless = No... | 27.9 | 79 | 0.687097 |
4b2e7358aad0ca0f81d0bcd5fbe78cf73b54a6e2 | 1,927 | py | Python | build/env/lib/python2.7/site-packages/ipython-0.10-py2.7.egg/share/doc/ipython/examples/core/example-embed-short.py | lumanjiao/XLS_BigData | 2c4c37872b8636df1c8b0e005bc12a635a753c7a | [
"Apache-2.0"
] | 11 | 2019-03-20T07:38:35.000Z | 2021-06-18T09:42:46.000Z | docs/examples/core/example-embed-short.py | 08saikiranreddy/ipython | 3498382180ad409592f46a9dd0d190ca917bfbff | [
"BSD-3-Clause-Clear"
] | 1 | 2015-07-16T22:26:53.000Z | 2015-07-16T22:26:53.000Z | docs/examples/core/example-embed-short.py | 08saikiranreddy/ipython | 3498382180ad409592f46a9dd0d190ca917bfbff | [
"BSD-3-Clause-Clear"
] | 5 | 2019-06-29T03:13:02.000Z | 2020-04-23T04:47:11.000Z | """Quick code snippets for embedding IPython into other programs.
See example-embed.py for full details, this file has the bare minimum code for
cut and paste use once you understand how to use the system."""
#---------------------------------------------------------------------------
# This code loads IPython but mo... | 37.057692 | 78 | 0.609237 |
baa00a3c2a658318940fc026e380e597ed431470 | 3,625 | py | Python | examples/inference/python/test/ls_bert.py | hexisyztem/lightseq | 25265dabaaee42ee9e7b7ec43c8c04fb90292733 | [
"Apache-2.0"
] | 106 | 2019-12-06T09:02:58.000Z | 2020-09-09T07:12:21.000Z | examples/inference/python/test/ls_bert.py | hexisyztem/lightseq | 25265dabaaee42ee9e7b7ec43c8c04fb90292733 | [
"Apache-2.0"
] | null | null | null | examples/inference/python/test/ls_bert.py | hexisyztem/lightseq | 25265dabaaee42ee9e7b7ec43c8c04fb90292733 | [
"Apache-2.0"
] | 15 | 2019-12-09T05:44:28.000Z | 2020-09-04T03:43:56.000Z | import time
import argparse
import torch
import lightseq.inference as lsi
from transformers import BertTokenizer, BertForSequenceClassification
def ls_bert(model, inputs, attn_mask):
torch.cuda.synchronize()
start_time = time.perf_counter()
ls_output = model.infer(inputs, attn_mask)
torch.cuda.synchr... | 32.079646 | 86 | 0.670621 |
bbf1146cea0379d8aa5f4bdf3e9a2b009a116e7e | 6,338 | py | Python | dataset.py | SolitaryKnife/pytorch_dataset | 36773064b333d0aafc1c5d0e559271c56516afe7 | [
"MIT"
] | null | null | null | dataset.py | SolitaryKnife/pytorch_dataset | 36773064b333d0aafc1c5d0e559271c56516afe7 | [
"MIT"
] | null | null | null | dataset.py | SolitaryKnife/pytorch_dataset | 36773064b333d0aafc1c5d0e559271c56516afe7 | [
"MIT"
] | null | null | null | from torch.utils.data.dataset import *
class ValueDataset(Dataset):
__slots__ = ["values", "transform"]
def __init__(self, values, transform=None):
assert callable(getattr(values, "__len__", None))
assert callable(getattr(values, "__getitem__", None))
assert callable(transform) or tr... | 26.518828 | 83 | 0.627643 |
c67617ebe832e48424c4cc75e187674aac96f8fe | 2,042 | py | Python | Examples/Python/api/main.py | LykkeCity/Trading-API | 6d9d7ee07865acc25422b1f86c575857e3cc2cc4 | [
"Apache-2.0"
] | null | null | null | Examples/Python/api/main.py | LykkeCity/Trading-API | 6d9d7ee07865acc25422b1f86c575857e3cc2cc4 | [
"Apache-2.0"
] | 5 | 2020-10-20T06:41:11.000Z | 2021-11-29T21:55:51.000Z | Examples/Python/api/main.py | LykkeCity/Trading-API | 6d9d7ee07865acc25422b1f86c575857e3cc2cc4 | [
"Apache-2.0"
] | 7 | 2020-07-23T09:54:21.000Z | 2022-02-04T06:49:19.000Z | import grpc
import common_pb2
import common_pb2_grpc
import privateService_pb2
import privateService_pb2_grpc
import publicService_pb2
import publicService_pb2_grpc
import google.protobuf
ssl_credentials = grpc.ssl_channel_credentials()
# use auth creds
token_credentials = grpc.access_token_call_credentials("HFT-ACCO... | 27.226667 | 113 | 0.77522 |
c1a6b6069286b247c56f516a0555650e9e86849c | 17,743 | py | Python | rep/estimators/tmva.py | HolyBayes/rep | 8a8d70f87e148e6fd73ff0c3a8606e6074a5c47b | [
"Apache-2.0"
] | null | null | null | rep/estimators/tmva.py | HolyBayes/rep | 8a8d70f87e148e6fd73ff0c3a8606e6074a5c47b | [
"Apache-2.0"
] | null | null | null | rep/estimators/tmva.py | HolyBayes/rep | 8a8d70f87e148e6fd73ff0c3a8606e6074a5c47b | [
"Apache-2.0"
] | null | null | null | """
These classes are wrappers for physics machine learning library TMVA used .root format files (c++ library).
Now you can simply use it in python. TMVA contains classification and regression algorithms, including neural networks.
See `TMVA guide <http://mirror.yandex.ru/gentoo-distfiles/distfiles/TMVAUsersGuide-v4.03... | 40.976905 | 129 | 0.619963 |
f26da233415b2d91e06f752c11d037acafbcde62 | 17,944 | py | Python | tests/test_spider.py | Maransatto/scrapy | 886513c3751b92e42dcc8cb180d4c15a5a11ccaf | [
"BSD-3-Clause"
] | 3 | 2018-11-13T03:01:17.000Z | 2018-11-13T03:01:20.000Z | tests/test_spider.py | Maransatto/scrapy | 886513c3751b92e42dcc8cb180d4c15a5a11ccaf | [
"BSD-3-Clause"
] | 2 | 2021-09-20T19:54:11.000Z | 2022-03-22T20:43:28.000Z | tests/test_spider.py | Maransatto/scrapy | 886513c3751b92e42dcc8cb180d4c15a5a11ccaf | [
"BSD-3-Clause"
] | 1 | 2021-03-30T13:11:34.000Z | 2021-03-30T13:11:34.000Z | import gzip
import inspect
import warnings
from io import BytesIO
from testfixtures import LogCapture
from twisted.trial import unittest
from scrapy import signals
from scrapy.settings import Settings
from scrapy.http import Request, Response, TextResponse, XmlResponse, HtmlResponse
from scrapy.spiders.init import In... | 37.936575 | 140 | 0.617198 |
595b77b6995ff118a7fe08559bea55dd7bc33191 | 482 | py | Python | test_save_search.py | Concrete18/Game-Save-Manager | 9a8040bb3c9fc97dc80ed986c79cfe1ee95d106e | [
"blessing"
] | 2 | 2020-12-23T04:18:15.000Z | 2021-12-13T10:17:56.000Z | test_save_search.py | Concrete18/Game-Save-Manager | 9a8040bb3c9fc97dc80ed986c79cfe1ee95d106e | [
"blessing"
] | null | null | null | test_save_search.py | Concrete18/Game-Save-Manager | 9a8040bb3c9fc97dc80ed986c79cfe1ee95d106e | [
"blessing"
] | null | null | null | from classes.save_search import Save_Search
from classes.game import Game
import unittest
class TestBackup(unittest.TestCase):
def test_game_save_location_search(self):
'''
Game Save Search
'''
main = Save_Search(Game, 1)
path = r'C:\Users\Michael\AppData\Local\Teardown'
... | 24.1 | 79 | 0.674274 |
29e1c7f1b3219ec989127cd227e6c50ca5a6fec2 | 775 | py | Python | NBA_SPORTSVU_SAMPLE_FILE/parsetest.py | ykataoka/NBA_TrajectoryAnalytics | 8cdbf9deb77bbd7e11e3447e968b154c967143be | [
"MIT"
] | null | null | null | NBA_SPORTSVU_SAMPLE_FILE/parsetest.py | ykataoka/NBA_TrajectoryAnalytics | 8cdbf9deb77bbd7e11e3447e968b154c967143be | [
"MIT"
] | null | null | null | NBA_SPORTSVU_SAMPLE_FILE/parsetest.py | ykataoka/NBA_TrajectoryAnalytics | 8cdbf9deb77bbd7e11e3447e968b154c967143be | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import xmltodict
import json
import glob
# xml = '''<?xml version="1.0"?>
# <root>
# <parent>
# <child a="foo">
# Hello, world!!
# </child>
# </parent>
# </root>
# '''
xmlfiles = glob.glob('*.XML')
xsdfiles = glob.glob('*.xsd')
print xmlfiles
print xsd... | 19.375 | 43 | 0.565161 |
a31bf0ff37b55d3780d4f45ff3d2151f304be97f | 1,329 | py | Python | algorithmic_heights/cc/cc_logic.py | ivanyu/rosalind | b3d05347401d261bb146eef0f4c75d84562d54b0 | [
"MIT"
] | 1 | 2019-09-24T15:57:09.000Z | 2019-09-24T15:57:09.000Z | algorithmic_heights/cc/cc_logic.py | ivanyu/rosalind | b3d05347401d261bb146eef0f4c75d84562d54b0 | [
"MIT"
] | null | null | null | algorithmic_heights/cc/cc_logic.py | ivanyu/rosalind | b3d05347401d261bb146eef0f4c75d84562d54b0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
def cc(graph):
def _dfs_traversal(graph, t, visited):
for v in graph[t]:
if v not in visited:
visited.add(v)
_dfs_traversal(graph, v, visited)
visited = set()
cnt = 0
for v in range(len(graph)):
... | 22.913793 | 57 | 0.453725 |
04095fd7685da05bf5b642d34c7ea00262d5d14f | 4,875 | py | Python | qtUI/debugWindow.py | jupiterbjy/python-macro-practice | 13dec1a7d85ea7abed0ac5d42327a04a6b48a7c4 | [
"MIT"
] | 2 | 2020-10-16T23:20:27.000Z | 2021-10-11T19:55:45.000Z | qtUI/debugWindow.py | jupiterbjy/python-macro-practice | 13dec1a7d85ea7abed0ac5d42327a04a6b48a7c4 | [
"MIT"
] | null | null | null | qtUI/debugWindow.py | jupiterbjy/python-macro-practice | 13dec1a7d85ea7abed0ac5d42327a04a6b48a7c4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
################################################################################
## Form generated from reading UI file 'debugWindow.ui'
##
## Created by: Qt User Interface Compiler version 5.14.2
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
##############... | 43.918919 | 128 | 0.686769 |
aad2003a562d6e0dad363875fcaabbe304ed081a | 8,297 | py | Python | tests/func/test_move.py | itcarroll/dvc | 55219e9089005ac15d668ecf735aeaf31a771d0b | [
"Apache-2.0"
] | 1 | 2022-03-16T13:27:40.000Z | 2022-03-16T13:27:40.000Z | tests/func/test_move.py | itcarroll/dvc | 55219e9089005ac15d668ecf735aeaf31a771d0b | [
"Apache-2.0"
] | 41 | 2021-11-16T15:38:50.000Z | 2022-03-30T10:32:14.000Z | tests/func/test_move.py | jhhuh/dvc | fecc81e951efeaa8130264f726c27e92876422ae | [
"Apache-2.0"
] | null | null | null | import os
import textwrap
import pytest
from dvc.cli import main
from dvc.dvcfile import DVC_FILE_SUFFIX
from dvc.exceptions import DvcException, MoveNotDataSourceError
from dvc.utils.serialize import load_yaml
from tests.basic_env import TestDvc, TestDvcGit
from tests.func.test_repro import TestRepro
from tests.util... | 30.616236 | 79 | 0.646258 |
c23aca342113c333521003569b3ba0896a381926 | 11,131 | py | Python | platform/bq/third_party/google_reauth/reauth.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | null | null | null | platform/bq/third_party/google_reauth/reauth.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | null | null | null | platform/bq/third_party/google_reauth/reauth.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2017 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | 35.5623 | 79 | 0.670021 |
79043cf41aa29b5fb39b3b7e7cd4edd485a95348 | 8,812 | py | Python | custom_components/xiaomi_gateway3/__init__.py | avbor/HomeAssistantConf | 1f0fe16c8e3f3dcea7cc350f3fb9c233b6a22614 | [
"Unlicense"
] | 35 | 2021-02-25T06:30:42.000Z | 2022-03-09T20:18:47.000Z | custom_components/xiaomi_gateway3/__init__.py | avbor/HomeAssistantConf | 1f0fe16c8e3f3dcea7cc350f3fb9c233b6a22614 | [
"Unlicense"
] | 33 | 2021-11-22T16:30:43.000Z | 2022-03-29T18:00:13.000Z | custom_components/xiaomi_gateway3/__init__.py | avbor/HomeAssistantConf | 1f0fe16c8e3f3dcea7cc350f3fb9c233b6a22614 | [
"Unlicense"
] | 19 | 2021-02-20T05:29:58.000Z | 2022-02-05T16:22:30.000Z | import asyncio
import logging
import voluptuous as vol
from homeassistant.components.system_log import CONF_LOGGER
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import EVENT_HOMEASSISTANT_STOP
from homeassistant.core import HomeAssistant, Event
from homeassistant.helpers import config_v... | 32.758364 | 79 | 0.661825 |
c10d8f08218b22f201026b2ee8b086a98377fec6 | 95 | py | Python | src/vmc/webhook/thehive/apps.py | mSALDANHAf/vmc | 2475395a41284356a93ba7d523f4bcf2e5ef1ef7 | [
"Apache-2.0"
] | 37 | 2020-05-30T14:51:23.000Z | 2022-03-30T00:56:48.000Z | src/vmc/webhook/thehive/apps.py | mSALDANHAf/vmc | 2475395a41284356a93ba7d523f4bcf2e5ef1ef7 | [
"Apache-2.0"
] | 20 | 2019-12-05T01:06:43.000Z | 2022-02-16T17:37:52.000Z | src/vmc/webhook/thehive/apps.py | mSALDANHAf/vmc | 2475395a41284356a93ba7d523f4bcf2e5ef1ef7 | [
"Apache-2.0"
] | 10 | 2019-12-11T08:03:03.000Z | 2022-03-24T08:31:56.000Z | from django.apps import AppConfig
class TheHive(AppConfig):
name = 'vmc.webhook.thehive'
| 15.833333 | 33 | 0.747368 |
78cc7c137897ea590468a36d429848ccb172ce78 | 33,554 | py | Python | O365/connection.py | jtweeder/python-o365 | b2863d95e13066cb544ff6c620f451e8eee11d8b | [
"Apache-2.0"
] | null | null | null | O365/connection.py | jtweeder/python-o365 | b2863d95e13066cb544ff6c620f451e8eee11d8b | [
"Apache-2.0"
] | null | null | null | O365/connection.py | jtweeder/python-o365 | b2863d95e13066cb544ff6c620f451e8eee11d8b | [
"Apache-2.0"
] | null | null | null | import json
import logging
import os
import time
import warnings
from pathlib import Path
from oauthlib.oauth2 import TokenExpiredError
from requests import Session
from requests.adapters import HTTPAdapter
from requests.exceptions import HTTPError, RequestException, ProxyError
from requests.exceptions import SSLError... | 42.259446 | 144 | 0.618406 |
36f8c6bf1b1f15eb867ce7f6cd5a26cec6eb5895 | 293 | py | Python | shows/Shows.py | stuporglue/hammond | dde0198afc269406e5b6e5057faa68866f765d06 | [
"MIT"
] | null | null | null | shows/Shows.py | stuporglue/hammond | dde0198afc269406e5b6e5057faa68866f765d06 | [
"MIT"
] | null | null | null | shows/Shows.py | stuporglue/hammond | dde0198afc269406e5b6e5057faa68866f765d06 | [
"MIT"
] | null | null | null | from shows.Adventure import Adventure
from shows.Clouds import Clouds
from shows.JurrasicPark import JurrasicPark
from shows.Roar import Roar
from shows.Roar2 import Roar2
from shows.Volcano import Volcano
from shows.Waves import Waves
from shows.Testing_The_Fences import Testing_The_Fences
| 32.555556 | 55 | 0.860068 |
095c2b3bd06ed4d23d6f2fa1eb6fd179771c1c10 | 761 | py | Python | interaction/views.py | hugocorra/bjorncrm | 1304b90c1f7d32942e1b4987c43a2ff9dede22dd | [
"MIT"
] | 2 | 2018-08-27T00:47:18.000Z | 2020-12-11T01:23:59.000Z | interaction/views.py | hugocorra/bjorncrm | 1304b90c1f7d32942e1b4987c43a2ff9dede22dd | [
"MIT"
] | null | null | null | interaction/views.py | hugocorra/bjorncrm | 1304b90c1f7d32942e1b4987c43a2ff9dede22dd | [
"MIT"
] | 1 | 2020-12-11T01:24:02.000Z | 2020-12-11T01:24:02.000Z | from django.shortcuts import render
from django.views.generic import ListView
from django.views.generic.edit import CreateView, DeleteView, UpdateView
from django.urls import reverse_lazy
from contacts.models import Contato
from interaction.forms import InteracaoForm
from interaction.models import Interacao, Interacao... | 30.44 | 73 | 0.78975 |
22006fcb2197796b2e95b6099fc90ed7fece7e0c | 817 | py | Python | main.py | SalSatSat/RandomHadith | 1077caa6ebb9be8a71c9c24ef9c89fe41cb4dced | [
"MIT"
] | null | null | null | main.py | SalSatSat/RandomHadith | 1077caa6ebb9be8a71c9c24ef9c89fe41cb4dced | [
"MIT"
] | null | null | null | main.py | SalSatSat/RandomHadith | 1077caa6ebb9be8a71c9c24ef9c89fe41cb4dced | [
"MIT"
] | null | null | null | import requests
import json
from Utils import printJSON
from Book import Book
def initBooks() -> []:
try:
response = requests.get("https://ahadith-api.herokuapp.com/api/books/en")
# print(response.status_code)
# printJSON(response.json())
booksText = json.dumps(response.json(), sor... | 26.354839 | 81 | 0.642595 |
f23a9d64736feefd99073bc5f184386ba83b318a | 11,119 | py | Python | N420_app/growbox.py | mattmatt91/N420 | 443d5e681800cb5bff468bb574407bbbbd6e221e | [
"MIT"
] | null | null | null | N420_app/growbox.py | mattmatt91/N420 | 443d5e681800cb5bff468bb574407bbbbd6e221e | [
"MIT"
] | null | null | null | N420_app/growbox.py | mattmatt91/N420 | 443d5e681800cb5bff468bb574407bbbbd6e221e | [
"MIT"
] | null | null | null |
from datetime import datetime, timedelta
from time import sleep, time
from log_data import Logger,Preferences
from gpiozero import CPUTemperature
from sensors import Sensor
import json as js
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
class Growbox():
actuators = []
Sensor()
cpu = CPUT... | 31.321127 | 145 | 0.583596 |
0f4c1d4399d64377b2d90f689aecf24be86501fd | 12,877 | py | Python | django/contrib/gis/db/models/sql/compiler.py | egenerat/gae-django | f12379483cf3917ed3cb46ca5ff0b94daf89fc50 | [
"MIT"
] | 3 | 2016-07-08T23:49:32.000Z | 2018-04-15T22:55:01.000Z | django/contrib/gis/db/models/sql/compiler.py | egenerat/gae-django | f12379483cf3917ed3cb46ca5ff0b94daf89fc50 | [
"MIT"
] | 27 | 2017-02-05T15:57:04.000Z | 2018-04-15T22:57:26.000Z | django/contrib/gis/db/models/sql/compiler.py | egenerat/gae-django | f12379483cf3917ed3cb46ca5ff0b94daf89fc50 | [
"MIT"
] | null | null | null | from itertools import izip
from django.db.backends.util import truncate_name
from django.db.models.sql import compiler
from django.db.models.sql.constants import TABLE_NAME
from django.db.models.sql.query import get_proxied_model
SQLCompiler = compiler.SQLCompiler
class GeoSQLCompiler(compiler.SQLCompiler):
... | 46.154122 | 107 | 0.578318 |
483f2072e600e60a0b7b669a6aa27e9f9fa59e34 | 4,010 | py | Python | CryptoLib/RSA/RSA.py | J-SB/ModernCryptoLib | 7f3532933933a4c558d5ba25bdbb8e9cb8d06819 | [
"MIT"
] | 12 | 2018-02-16T21:37:00.000Z | 2022-02-23T03:19:57.000Z | CryptoLib/RSA/RSA.py | J-SB/ModernCryptoLib | 7f3532933933a4c558d5ba25bdbb8e9cb8d06819 | [
"MIT"
] | 1 | 2020-10-08T14:11:16.000Z | 2020-10-08T14:11:16.000Z | CryptoLib/RSA/RSA.py | J-SB/ModernCryptoLib | 7f3532933933a4c558d5ba25bdbb8e9cb8d06819 | [
"MIT"
] | 5 | 2018-02-16T21:37:02.000Z | 2020-10-08T05:08:24.000Z | class utilities:
@staticmethod
def egcd(a,b):
from RSA_Attacks.utilities import egcd
return egcd(a,b)
@staticmethod
def modinv(a,m):
from RSA_Attacks.utilities import modinv
return modinv(a,m)
@staticmethod
def mulinv(a,b):
from RSA_Attacks.utilities import mulinv
return mulinv(a,b)
@st... | 32.08 | 91 | 0.685287 |
ab4a74e36c7925b14a45caa6f6fe4bcd7664a339 | 3,236 | py | Python | test/IECoreScene/SharedSceneInterfacesTest.py | ericmehl/cortex | 054839cc709ce153d1bcaaefe7f340ebe641ec82 | [
"BSD-3-Clause"
] | 386 | 2015-01-02T11:10:43.000Z | 2022-03-10T15:12:20.000Z | test/IECoreScene/SharedSceneInterfacesTest.py | ericmehl/cortex | 054839cc709ce153d1bcaaefe7f340ebe641ec82 | [
"BSD-3-Clause"
] | 484 | 2015-01-09T18:28:06.000Z | 2022-03-31T16:02:04.000Z | test/IECoreScene/SharedSceneInterfacesTest.py | ericmehl/cortex | 054839cc709ce153d1bcaaefe7f340ebe641ec82 | [
"BSD-3-Clause"
] | 99 | 2015-01-28T23:18:04.000Z | 2022-03-27T00:59:39.000Z | ##########################################################################
#
# Copyright (c) 2019, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistrib... | 38.52381 | 117 | 0.699629 |
8fdc11da2ffbfc6a5379bebb23e4079215634750 | 839 | py | Python | services/datasource/datasources/ch_workflow.py | xUndero/noc | 9fb34627721149fcf7064860bd63887e38849131 | [
"BSD-3-Clause"
] | 1 | 2019-09-20T09:36:48.000Z | 2019-09-20T09:36:48.000Z | services/datasource/datasources/ch_workflow.py | ewwwcha/noc | aba08dc328296bb0e8e181c2ac9a766e1ec2a0bb | [
"BSD-3-Clause"
] | null | null | null | services/datasource/datasources/ch_workflow.py | ewwwcha/noc | aba08dc328296bb0e8e181c2ac9a766e1ec2a0bb | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# ----------------------------------------------------------------------
# CHWorkflow datasource
# ----------------------------------------------------------------------
# Copyright (C) 2007-2018 The NOC Project
# See LICENSE for details
# --------------------------------------------------------... | 29.964286 | 87 | 0.504172 |
c832e2d2d4d58c651fcdef05e8a75f935d05929c | 23,186 | py | Python | tests/sentry/plugins/mail/tests.py | practo/sentry | 82f530970ce205696469fa702246396acfd947a1 | [
"BSD-3-Clause"
] | null | null | null | tests/sentry/plugins/mail/tests.py | practo/sentry | 82f530970ce205696469fa702246396acfd947a1 | [
"BSD-3-Clause"
] | 1 | 2019-03-13T06:05:24.000Z | 2019-03-13T06:05:24.000Z | tests/sentry/plugins/mail/tests.py | practo/sentry | 82f530970ce205696469fa702246396acfd947a1 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from datetime import datetime
import mock
import pytz
import six
from django.contrib.auth.models import AnonymousUser
from django.core import mail
from django.utils import timezone
from exam import fixture
from mock import Mock
from sentry.api.serialize... | 34.60597 | 134 | 0.608169 |
32059d38dc84186bbc0a900fc3c110da6c15d232 | 11,268 | py | Python | src/podis/supply.py | edwardoughton/ictp4d | 0e36b3c4515e57cc9210bd22f2ab761f2aa750d6 | [
"MIT"
] | 4 | 2021-02-07T19:36:57.000Z | 2021-05-20T16:46:02.000Z | src/podis/supply.py | edwardoughton/ictp4d | 0e36b3c4515e57cc9210bd22f2ab761f2aa750d6 | [
"MIT"
] | null | null | null | src/podis/supply.py | edwardoughton/ictp4d | 0e36b3c4515e57cc9210bd22f2ab761f2aa750d6 | [
"MIT"
] | null | null | null | """
Optimize supply
Written by Ed Oughton.
Winter 2020
"""
import math
from itertools import tee
from operator import itemgetter
from podis.costs import find_network_cost
def estimate_supply(country, regions, capacity_lut, option, global_parameters,
country_parameters, costs, core_lut, ci):
"""
For ea... | 30.128342 | 91 | 0.627707 |
2615ee2e78efa1c3d3a525d37c7990a0ec2cec7e | 3,957 | py | Python | sagas/nlu/locales.py | samlet/stack | 47db17fd4fdab264032f224dca31a4bb1d19b754 | [
"Apache-2.0"
] | 3 | 2020-01-11T13:55:38.000Z | 2020-08-25T22:34:15.000Z | sagas/nlu/locales.py | samlet/stack | 47db17fd4fdab264032f224dca31a4bb1d19b754 | [
"Apache-2.0"
] | null | null | null | sagas/nlu/locales.py | samlet/stack | 47db17fd4fdab264032f224dca31a4bb1d19b754 | [
"Apache-2.0"
] | 1 | 2021-01-01T05:21:44.000Z | 2021-01-01T05:21:44.000Z | def get_locale(lang):
"""
import sagas.nlu.locales as locales
locales.get_locale('ja')
:param lang:
:return:
"""
from iso639 import languages
aragonese = languages.get(part1=lang)
return aragonese.part3
class LocaleTable(object):
def __init__(self):
self.data = {}
d... | 28.467626 | 69 | 0.504423 |
7d4f1d3338a26437609408533209b6e613b519e7 | 16,820 | py | Python | pymc3/plots.py | MichielCottaar/pymc3 | f37198653e7d09881e7bc411cbd10fffbab442c2 | [
"Apache-2.0"
] | 1 | 2020-09-29T12:32:32.000Z | 2020-09-29T12:32:32.000Z | pymc3/plots.py | MichielCottaar/pymc3 | f37198653e7d09881e7bc411cbd10fffbab442c2 | [
"Apache-2.0"
] | null | null | null | pymc3/plots.py | MichielCottaar/pymc3 | f37198653e7d09881e7bc411cbd10fffbab442c2 | [
"Apache-2.0"
] | null | null | null | import numpy as np
from scipy.stats import kde
from .stats import *
from numpy.linalg import LinAlgError
__all__ = ['traceplot', 'kdeplot', 'kde2plot', 'forestplot', 'autocorrplot']
def traceplot(trace, vars=None, figsize=None,
lines=None, combined=False, grid=True,
alpha=0.35, ax=None):... | 30.361011 | 89 | 0.511356 |
2b9d467dde816dbe452a3aba4c8c3119aea4b50f | 2,790 | py | Python | deprecated_examples/robotics/unimodal_image-pred.py | TianhaoFu/MultiBench | b174a3187124d6f92be1ff3b487eef292f7883bb | [
"MIT"
] | null | null | null | deprecated_examples/robotics/unimodal_image-pred.py | TianhaoFu/MultiBench | b174a3187124d6f92be1ff3b487eef292f7883bb | [
"MIT"
] | null | null | null | deprecated_examples/robotics/unimodal_image-pred.py | TianhaoFu/MultiBench | b174a3187124d6f92be1ff3b487eef292f7883bb | [
"MIT"
] | null | null | null | import sys
import os
sys.path.insert(0, os.getcwd())
import time
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import yaml
import os
from tqdm import tqdm
from fusions.robotics.sensor_fusion import SensorFusionSelfSupervised,roboticsConcat
from unimodals.robotics.encoders import ... | 33.214286 | 165 | 0.657706 |
bf2d252c74ebd044b76fe504e27414cec7d79fa3 | 9,228 | py | Python | raiden/accounts.py | destenson/raiden-network--raiden | 845b3d9d8440e4f12b82854194fd6c9e1500b991 | [
"MIT"
] | null | null | null | raiden/accounts.py | destenson/raiden-network--raiden | 845b3d9d8440e4f12b82854194fd6c9e1500b991 | [
"MIT"
] | null | null | null | raiden/accounts.py | destenson/raiden-network--raiden | 845b3d9d8440e4f12b82854194fd6c9e1500b991 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import getpass
import json
import os
import sys
from binascii import hexlify, unhexlify
from bitcoin import privtopub
from ethereum.tools import keys
from ethereum.slogging import get_logger
log = get_logger(__name__)
def find_datadir():
home = os.path.expanduser('~')
if home == '~':... | 34.304833 | 99 | 0.588535 |
c17773c596f7dc3bc80a29eadbdc94b663cd43ef | 1,691 | py | Python | aries_cloudagent/protocols/issue_credential/v1_0/__init__.py | kuraakhilesh8230/aries-cloudagent-python | ee384d1330f6a50ff45a507392ce54f92900f23a | [
"Apache-2.0"
] | 247 | 2019-07-02T21:10:21.000Z | 2022-03-30T13:55:33.000Z | aries_cloudagent/protocols/issue_credential/v1_0/__init__.py | kuraakhilesh8230/aries-cloudagent-python | ee384d1330f6a50ff45a507392ce54f92900f23a | [
"Apache-2.0"
] | 1,462 | 2019-07-02T20:57:30.000Z | 2022-03-31T23:13:35.000Z | aries_cloudagent/protocols/issue_credential/v1_0/__init__.py | kuraakhilesh8230/aries-cloudagent-python | ee384d1330f6a50ff45a507392ce54f92900f23a | [
"Apache-2.0"
] | 377 | 2019-06-20T21:01:31.000Z | 2022-03-30T08:27:53.000Z | from typing import Coroutine, Union
from ....connections.models.conn_record import ConnRecord
from ....core.error import BaseError
from .messages.credential_problem_report import (
CredentialProblemReport,
ProblemReportReason,
)
from .models.credential_exchange import V10CredentialExchange
def problem_repor... | 26.421875 | 73 | 0.686576 |
df01734fab45f8b666075df224553691cc2f52d4 | 3,309 | py | Python | bauh/view/util/cache.py | leoneii/bauh | ceef6c30851552ec37e21ef6335a4cbdd126622f | [
"Zlib"
] | 1 | 2020-06-16T17:08:32.000Z | 2020-06-16T17:08:32.000Z | bauh/view/util/cache.py | octopusSD/bauh | c1f210fef87ddb4614b201ec2030330b71e43fe4 | [
"Zlib"
] | null | null | null | bauh/view/util/cache.py | octopusSD/bauh | c1f210fef87ddb4614b201ec2030330b71e43fe4 | [
"Zlib"
] | null | null | null | import datetime
import time
from threading import Lock, Thread
from bauh.api.abstract.cache import MemoryCache, MemoryCacheFactory
class DefaultMemoryCache(MemoryCache):
"""
A synchronized cache implementation
"""
def __init__(self, expiration_time: int):
super(DefaultMemoryCache, self).__in... | 29.283186 | 174 | 0.585675 |
4daae76531c62d58bc17b885ed6070b1093bf2ab | 689 | py | Python | atomisticparsers/namd/__init__.py | nomad-coe/atomistic-parsers | 7be55968fbf45e8e49377b58e745548c55c06788 | [
"Apache-2.0"
] | null | null | null | atomisticparsers/namd/__init__.py | nomad-coe/atomistic-parsers | 7be55968fbf45e8e49377b58e745548c55c06788 | [
"Apache-2.0"
] | null | null | null | atomisticparsers/namd/__init__.py | nomad-coe/atomistic-parsers | 7be55968fbf45e8e49377b58e745548c55c06788 | [
"Apache-2.0"
] | null | null | null | #
# Copyright The NOMAD Authors.
#
# This file is part of NOMAD.
# See https://nomad-lab.eu for further info.
#
# 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/lic... | 34.45 | 74 | 0.753266 |
a23341b4de3450dedbb7337b358d743e891ca2bc | 797 | py | Python | eagent/config.py | r-koike/eagent | b01f413ed90752fd1bbc4c6a59edf1c9020e11b8 | [
"MIT"
] | null | null | null | eagent/config.py | r-koike/eagent | b01f413ed90752fd1bbc4c6a59edf1c9020e11b8 | [
"MIT"
] | null | null | null | eagent/config.py | r-koike/eagent | b01f413ed90752fd1bbc4c6a59edf1c9020e11b8 | [
"MIT"
] | null | null | null | import json
import os
import glob
import copy
cfg_dict = {}
cfg_dirnames = []
cfg_dirnames.append(os.path.join("eagent", "configs", "ewalker"))
cfg_dirnames.append(os.path.join("eagent", "configs", "ehand_egg"))
default_filename = "default.json"
for cfg_dirname in cfg_dirnames:
with open(os.path.join(cfg_dirname,... | 29.518519 | 77 | 0.667503 |
5e48ce1049a400e53ff708b11af29471702ac060 | 1,662 | py | Python | container.py | bowmanjd/elm-builder-ia32 | b2433d7a21a57f4b5b5eb162688cd9f573308344 | [
"Apache-2.0"
] | 1 | 2019-01-17T19:21:30.000Z | 2019-01-17T19:21:30.000Z | container.py | bowmanjd/elm-builder | b2433d7a21a57f4b5b5eb162688cd9f573308344 | [
"Apache-2.0"
] | null | null | null | container.py | bowmanjd/elm-builder | b2433d7a21a57f4b5b5eb162688cd9f573308344 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3.7
import subprocess
import sys
import fire
arches = {"i386": "i386/", "x86_64": ""}
class Container:
def __init__(self, name, repo="bowmanjd"):
self.docker_exe = ["docker"]
if not sys.platform == "win32":
self.docker_exe.insert(0, "sudo")
self.location = f... | 29.157895 | 78 | 0.518051 |
46b76fe1b2bceb0626ba35e4b3e437b0b50ae1f1 | 19,712 | py | Python | drf_spectacular/utils.py | credativ/drf-spectacular | 2684fdae7c2c02d289fe8856d7f35a6d634b4a09 | [
"BSD-3-Clause"
] | null | null | null | drf_spectacular/utils.py | credativ/drf-spectacular | 2684fdae7c2c02d289fe8856d7f35a6d634b4a09 | [
"BSD-3-Clause"
] | null | null | null | drf_spectacular/utils.py | credativ/drf-spectacular | 2684fdae7c2c02d289fe8856d7f35a6d634b4a09 | [
"BSD-3-Clause"
] | null | null | null | import functools
import inspect
from typing import Any, Dict, List, Optional, Type, Union
from rest_framework.fields import Field, empty
from rest_framework.serializers import Serializer
from rest_framework.settings import api_settings
from drf_spectacular.drainage import error, get_view_methods, set_override, warn
f... | 41.324948 | 104 | 0.641487 |
6f7f577e36cfe50f1e1ed461f6f8a2fc4f900f51 | 3,451 | py | Python | qa/rpc-tests/mempool_resurrect_test.py | whiteangelsblack/bitcoinstx | ed75f5c9116c2a91e947998e0b5ffb84c76fa449 | [
"MIT"
] | null | null | null | qa/rpc-tests/mempool_resurrect_test.py | whiteangelsblack/bitcoinstx | ed75f5c9116c2a91e947998e0b5ffb84c76fa449 | [
"MIT"
] | null | null | null | qa/rpc-tests/mempool_resurrect_test.py | whiteangelsblack/bitcoinstx | ed75f5c9116c2a91e947998e0b5ffb84c76fa449 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test resurrection of mined transactions when
# the blockchain is re-organized.
#
from test_framework impo... | 38.775281 | 92 | 0.65836 |
1558cbc7b25234558b0f37ad81f3ab4110589317 | 2,357 | py | Python | allennlp/modules/attention/additive_attention.py | sun-xiaoyu/allennlp | b49aff6aac4e9912564ee8235250d50c9d17e53f | [
"Apache-2.0"
] | 4 | 2019-05-30T01:03:31.000Z | 2021-12-18T08:24:51.000Z | allennlp/modules/attention/additive_attention.py | sun-xiaoyu/allennlp | b49aff6aac4e9912564ee8235250d50c9d17e53f | [
"Apache-2.0"
] | 123 | 2020-04-26T02:41:30.000Z | 2021-08-02T21:18:00.000Z | allennlp/modules/attention/additive_attention.py | sun-xiaoyu/allennlp | b49aff6aac4e9912564ee8235250d50c9d17e53f | [
"Apache-2.0"
] | 5 | 2019-07-16T06:43:50.000Z | 2021-12-18T08:25:12.000Z | from overrides import overrides
import torch
from torch.nn.parameter import Parameter
from allennlp.modules.attention.attention import Attention
@Attention.register("additive")
class AdditiveAttention(Attention):
"""
Computes attention between a vector and a matrix using an additive attention function. This... | 45.326923 | 97 | 0.705558 |
8cc69d55fb5c5dae6d1fd12ec9569bab7e59fdb7 | 376 | py | Python | deploy/nsis.py | roman-st/DeployTool | af6bda37ef84f06358c875f4d07609287432c4f3 | [
"MIT"
] | null | null | null | deploy/nsis.py | roman-st/DeployTool | af6bda37ef84f06358c875f4d07609287432c4f3 | [
"MIT"
] | null | null | null | deploy/nsis.py | roman-st/DeployTool | af6bda37ef84f06358c875f4d07609287432c4f3 | [
"MIT"
] | null | null | null | from install import RemoteInstaller
def install(remoteInstaller, setup, install_path):
install_cmd = '{0} /S /D={1}'.format(setup, install_path)
return remoteInstaller.install(install_cmd)
def uninstall(remoteInstaller, uninstaller, install_path):
uninstall_cmd = '{0}/{1} /S'.format(install_path, uninstal... | 41.777778 | 66 | 0.768617 |
3b733cc0b14f1bfc642057dabbe213bc782291f7 | 52 | py | Python | app/purchase/tests/__init__.py | phessabi/eshop | 6a5352753a0c27f9c3f0eda6eec696f49ef4a8eb | [
"Apache-2.0"
] | 1 | 2020-02-04T21:18:31.000Z | 2020-02-04T21:18:31.000Z | app/purchase/tests/__init__.py | phessabi/eshop | 6a5352753a0c27f9c3f0eda6eec696f49ef4a8eb | [
"Apache-2.0"
] | 12 | 2020-01-01T11:46:33.000Z | 2022-03-12T00:10:01.000Z | app/purchase/tests/__init__.py | phessabi/eshop | 6a5352753a0c27f9c3f0eda6eec696f49ef4a8eb | [
"Apache-2.0"
] | 1 | 2020-02-18T11:12:48.000Z | 2020-02-18T11:12:48.000Z | from .api_tests.purchase import PurchaseAPITestCase
| 26 | 51 | 0.884615 |
b13c2ff6119f163151e3a139863c64f3bc4e9f64 | 18,331 | py | Python | ow/views/user.py | openworkouts/OpenWorkouts | ecfed69e8c654c09bb8c074d8aedda9c13cd2235 | [
"BSD-3-Clause"
] | 3 | 2019-02-15T11:38:20.000Z | 2020-10-03T19:03:51.000Z | ow/views/user.py | openworkouts/OpenWorkouts | ecfed69e8c654c09bb8c074d8aedda9c13cd2235 | [
"BSD-3-Clause"
] | null | null | null | ow/views/user.py | openworkouts/OpenWorkouts | ecfed69e8c654c09bb8c074d8aedda9c13cd2235 | [
"BSD-3-Clause"
] | null | null | null | import json
from datetime import datetime, timezone, timedelta
from decimal import Decimal
from io import BytesIO
from pyramid.httpexceptions import HTTPFound, HTTPNotFound
from pyramid.view import view_config
from pyramid.security import remember, forget
from pyramid.response import Response
from pyramid.i18n import ... | 35.732943 | 79 | 0.632644 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.