hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | 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 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d337164ee159dedaf5a0ab412ffc1948f44322f7 | 17 | py | Python | bionic/simulation/__init__.py | Pendragonek/bionic | 65b46835644dfaf80f23147a3a47e37504b1f880 | [
"MIT"
] | null | null | null | bionic/simulation/__init__.py | Pendragonek/bionic | 65b46835644dfaf80f23147a3a47e37504b1f880 | [
"MIT"
] | null | null | null | bionic/simulation/__init__.py | Pendragonek/bionic | 65b46835644dfaf80f23147a3a47e37504b1f880 | [
"MIT"
] | null | null | null | """Simulation"""
| 8.5 | 16 | 0.588235 | """Simulation"""
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9d09f818cc3b4f1b2e4efef2328777875a542465 | 4,337 | py | Python | 432.All-O-one-Data-Structure.py | mickey0524/leetcode | 6bedeb6ff29b02a97178cca464c5fd639951801f | [
"MIT"
] | 18 | 2018-07-14T12:45:37.000Z | 2022-03-26T14:51:04.000Z | 432.All-O-one-Data-Structure.py | mickey0524/leetcode | 6bedeb6ff29b02a97178cca464c5fd639951801f | [
"MIT"
] | null | null | null | 432.All-O-one-Data-Structure.py | mickey0524/leetcode | 6bedeb6ff29b02a97178cca464c5fd639951801f | [
"MIT"
] | 3 | 2019-05-29T04:09:22.000Z | 2021-06-07T23:37:46.000Z | # https://leetcode.com/problems/all-oone-data-structure/
#
# algorithms
# Hard (29.33%)
# Total Accepted: 17,753
# Total Submissions: 60,523
# Your AllOne object will be instantiated and called as such:
# obj = AllOne()
# obj.inc(key)
# obj.dec(key)
# param_3 = obj.getMaxKey()
# param_4 = obj.getMinKey()
| 30.758865 | 96 | 0.458843 | # https://leetcode.com/problems/all-oone-data-structure/
#
# algorithms
# Hard (29.33%)
# Total Accepted: 17,753
# Total Submissions: 60,523
class ListNode(object):
def __init__(self, k):
self.k = k
self.pre = None
self.next = None
class AllOne(object):
def __init__(self):
... | 0 | 0 | 0 | 3,979 | 0 | 0 | 0 | 0 | 46 |
3e4c7890e93905984a4c4d89c6a78f71b37ae901 | 1,716 | py | Python | scripts/MongoDash/layouts/sidebar_comp.py | RodrigoNaves/ginan-bitbucket-update-tests | 4bd5cc0a9dd0e94b1c2d8b35385e128404009b0c | [
"Apache-2.0"
] | 73 | 2021-07-08T23:35:08.000Z | 2022-03-31T15:17:58.000Z | scripts/MongoDash/layouts/sidebar_comp.py | RodrigoNaves/ginan-bitbucket-update-tests | 4bd5cc0a9dd0e94b1c2d8b35385e128404009b0c | [
"Apache-2.0"
] | 5 | 2021-09-27T14:27:32.000Z | 2022-03-21T23:50:02.000Z | scripts/MongoDash/layouts/sidebar_comp.py | RodrigoNaves/ginan-bitbucket-update-tests | 4bd5cc0a9dd0e94b1c2d8b35385e128404009b0c | [
"Apache-2.0"
] | 39 | 2021-07-12T05:42:51.000Z | 2022-03-31T15:15:34.000Z | """
This app creates a simple sidebar layout using inline style arguments and the
dbc.Nav component.
dcc.Location is used to track the current location. There are two callbacks,
one uses the current location to render the appropriate page content, the other
uses the current location to toggle the "active" properties o... | 27.677419 | 82 | 0.639277 | """
This app creates a simple sidebar layout using inline style arguments and the
dbc.Nav component.
dcc.Location is used to track the current location. There are two callbacks,
one uses the current location to render the appropriate page content, the other
uses the current location to toggle the "active" properties o... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 12 | 44 |
433a63f3ab1a0647908808bd0a388be2cf9c3a2c | 6,204 | py | Python | misc/python/materialize/cli/optbench.py | guylapid/materialize | 8629a120a5a628b6ef06f379b48ba723797db944 | [
"MIT"
] | 3,840 | 2020-02-13T18:28:21.000Z | 2022-03-31T17:25:04.000Z | misc/python/materialize/cli/optbench.py | guylapid/materialize | 8629a120a5a628b6ef06f379b48ba723797db944 | [
"MIT"
] | 5,802 | 2020-02-13T18:59:27.000Z | 2022-03-31T21:50:24.000Z | misc/python/materialize/cli/optbench.py | guylapid/materialize | 8629a120a5a628b6ef06f379b48ba723797db944 | [
"MIT"
] | 295 | 2020-02-13T18:49:32.000Z | 2022-03-30T10:55:12.000Z | # Copyright Materialize, Inc. and contributors. All rights reserved.
#
# Use of this software is governed by the Business Source License
# included in the LICENSE file at the root of this repository.
#
# As of the Change Date specified in that file, in accordance with
# the Business Source License, use of this software... | 26.973913 | 82 | 0.58833 | # Copyright Materialize, Inc. and contributors. All rights reserved.
#
# Use of this software is governed by the Business Source License
# included in the LICENSE file at the root of this repository.
#
# As of the Change Date specified in that file, in accordance with
# the Business Source License, use of this software... | 0 | 3,588 | 0 | 1,386 | 0 | 232 | 0 | 6 | 402 |
0582047abd140ee06d605738187cbd5def0bd356 | 2,736 | py | Python | storage/compression/recovery_function.py | alilakda/Eva | e3d447f81e1e47172e21758c059ad6f5ee21ffa4 | [
"Apache-2.0"
] | null | null | null | storage/compression/recovery_function.py | alilakda/Eva | e3d447f81e1e47172e21758c059ad6f5ee21ffa4 | [
"Apache-2.0"
] | null | null | null | storage/compression/recovery_function.py | alilakda/Eva | e3d447f81e1e47172e21758c059ad6f5ee21ffa4 | [
"Apache-2.0"
] | null | null | null |
"""
Recovery Function takes a query of frames from a compressed video and returns the original frames of the video,
function needs the compressed videos meta data and returns two lists, one list contains lists of rame sequences in the order
of the indexes passed to the function, the latter contains a flattten version ... | 26.307692 | 124 | 0.653874 | import numpy as np
import cv2
from tqdm import tqdm
"""
Recovery Function takes a query of frames from a compressed video and returns the original frames of the video,
function needs the compressed videos meta data and returns two lists, one list contains lists of rame sequences in the order
of the indexes passed to t... | 0 | 0 | 0 | 193 | 0 | 1,699 | 0 | -14 | 112 |
808741a0a2ec16d018a566fce476d8125091a166 | 10,737 | py | Python | darknet_video.py | ViditSheth77/Solecthon | bc9448b8315cb63c46f15ad88aafb4cbd846c046 | [
"MIT"
] | null | null | null | darknet_video.py | ViditSheth77/Solecthon | bc9448b8315cb63c46f15ad88aafb4cbd846c046 | [
"MIT"
] | null | null | null | darknet_video.py | ViditSheth77/Solecthon | bc9448b8315cb63c46f15ad88aafb4cbd846c046 | [
"MIT"
] | null | null | null | import time
import serial
CAM_NUM = 3
DANGER = 150
a = range(-75,-26)
b = range(-26,-19)
c = range(-19,-13)
d = range(-13,-7)
e = range(-7,0)
f = range(0,7)
g = range(7,13)
h = range(13,19)
i = range(19,26)
j = range(26,75)
m = range(-90,-26)
n = range(-26,-12)
o = range(-12,0)
p = range(0,12)
q = range(12,26)
r = r... | 31.486804 | 95 | 0.47965 | from ctypes import *
import math
import random
import os
import cv2
import numpy as np
import time
import darknet
import chcone
import serial
CAM_NUM = 3
DANGER = 150
a = range(-75,-26)
b = range(-26,-19)
c = range(-19,-13)
d = range(-13,-7)
e = range(-7,0)
f = range(0,7)
g = range(7,13)
h = range(13,19)
i = range(19... | 0 | 0 | 0 | 0 | 0 | 9,992 | 0 | -60 | 318 |
e0397a4aa70bad17cdc49f6671929d2f1e2bc7bb | 22 | py | Python | optclean/__init__.py | sjyk/OptClean | b1cbac930476c9ead7852ce204e5e11b0f55053b | [
"MIT"
] | null | null | null | optclean/__init__.py | sjyk/OptClean | b1cbac930476c9ead7852ce204e5e11b0f55053b | [
"MIT"
] | null | null | null | optclean/__init__.py | sjyk/OptClean | b1cbac930476c9ead7852ce204e5e11b0f55053b | [
"MIT"
] | null | null | null | #from domains import * | 22 | 22 | 0.772727 | #from domains import * | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a757992dee51b19941ff270b189f6f6248d976c5 | 2,003 | py | Python | torchsupport/modules/refine.py | bobelly/torchsupport | 5aa0a04f20c193ec99310f5d6a3375d2e95e740d | [
"MIT"
] | 18 | 2019-05-02T16:32:15.000Z | 2021-04-16T09:33:54.000Z | torchsupport/modules/refine.py | bobelly/torchsupport | 5aa0a04f20c193ec99310f5d6a3375d2e95e740d | [
"MIT"
] | 5 | 2019-10-14T13:46:49.000Z | 2021-06-08T11:48:34.000Z | torchsupport/modules/refine.py | bobelly/torchsupport | 5aa0a04f20c193ec99310f5d6a3375d2e95e740d | [
"MIT"
] | 12 | 2019-05-12T21:34:24.000Z | 2021-07-15T14:14:16.000Z | import torch.nn as nn
| 29.455882 | 82 | 0.648028 | import torch
import torch.nn as nn
import torch.nn.functional as func
from torchsupport.modules.normalization import AdaptiveBatchNorm
class ResBlock(nn.Module):
def __init__(self, size, ada_size):
super().__init__()
self.bn = AdaptiveBatchNorm(size, ada_size)
self.convs = nn.Sequential(
nn.ReLU()... | 0 | 0 | 0 | 1,798 | 0 | 0 | 0 | 47 | 136 |
54f5eda5ee8d94ceb2f3cd66188697f5ff699c70 | 9,281 | py | Python | Src/Tests/interop/net/field/test_literal_fields.py | Enerccio/ironpython26-fixed | e302db14f05396a378adb438565a829e66acbf94 | [
"MS-PL"
] | 1 | 2020-02-11T06:02:40.000Z | 2020-02-11T06:02:40.000Z | Src/Languages/IronPython/Tests/interop/net/field/test_literal_fields.py | rudimk/dlr-dotnet | 71d11769f99d6ff1516ddbaed091a359eb46c670 | [
"MS-PL"
] | null | null | null | Src/Languages/IronPython/Tests/interop/net/field/test_literal_fields.py | rudimk/dlr-dotnet | 71d11769f99d6ff1516ddbaed091a359eb46c670 | [
"MS-PL"
] | 1 | 2018-11-21T04:10:23.000Z | 2018-11-21T04:10:23.000Z | #####################################################################################
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# This source code is subject to terms and conditions of the Microsoft Public License. A
# copy of the license can be found in the License.html file at the root of this... | 41.806306 | 112 | 0.702941 | #####################################################################################
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# This source code is subject to terms and conditions of the Microsoft Public License. A
# copy of the license can be found in the License.html file at the root of this... | 0 | 0 | 0 | 0 | 0 | 7,124 | 0 | 53 | 292 |
7fcfee55c92fa946499bd3f9529fc94372f75719 | 306 | py | Python | tests/github/ops/test_update_org_member_lists.py | simonsobs/acondbs | 6ca11c2889d827ecdb2b54d0cf3b94b8cdd281e6 | [
"MIT"
] | null | null | null | tests/github/ops/test_update_org_member_lists.py | simonsobs/acondbs | 6ca11c2889d827ecdb2b54d0cf3b94b8cdd281e6 | [
"MIT"
] | 24 | 2020-04-02T19:29:07.000Z | 2022-03-08T03:05:43.000Z | tests/github/ops/test_update_org_member_lists.py | simonsobs/acondbs | 6ca11c2889d827ecdb2b54d0cf3b94b8cdd281e6 | [
"MIT"
] | 1 | 2020-04-08T15:48:28.000Z | 2020-04-08T15:48:28.000Z |
##__________________________________________________________________||
##__________________________________________________________________||
| 30.6 | 70 | 0.813725 | from acondbs.github.ops import update_org_member_lists
##__________________________________________________________________||
def test_call(app, snapshot):
with app.app_context():
# update_org_member_lists()
pass
##__________________________________________________________________||
| 0 | 0 | 0 | 0 | 0 | 85 | 0 | 33 | 44 |
e78c717ea1518d4d58afc40fc3fc9b6f68e207c4 | 1,268 | py | Python | fwl-automation-decisions/flask_app/controller/environment/EnvironmentController.py | aherculano/fwl-project | 6d4c4d40393b76d45cf13b572b5aabc0696e9285 | [
"MIT"
] | null | null | null | fwl-automation-decisions/flask_app/controller/environment/EnvironmentController.py | aherculano/fwl-project | 6d4c4d40393b76d45cf13b572b5aabc0696e9285 | [
"MIT"
] | null | null | null | fwl-automation-decisions/flask_app/controller/environment/EnvironmentController.py | aherculano/fwl-project | 6d4c4d40393b76d45cf13b572b5aabc0696e9285 | [
"MIT"
] | null | null | null | from flask_restx import Namespace, fields
api = Namespace("Environment", description="Datacenter Environment Functionality")
model = api.model("Environment", {
'environment_name': fields.String
})
| 28.177778 | 83 | 0.742902 | from application import EnvironmentController
from domain.model.environment import EnvironmentRepository
from flask_restx import Namespace, fields, Resource
from flask_restx.reqparse import RequestParser
from .EnvironmentMapperImpl import EnvironmentMapperImpl
from .EnvironmentDTOImpl import EnvironmentDTOImpl
from i... | 0 | 587 | 0 | 0 | 0 | 129 | 0 | 166 | 180 |
7351469759b08f927ac28411dbc1dd644bf34a91 | 111 | py | Python | src/communication/__init__.py | FrancoisChastel/DD2480_Software-Engineering_CI | 26424af8a349cc0abdc9a256bf91b161d989c702 | [
"BSD-2-Clause"
] | 1 | 2018-02-04T22:02:01.000Z | 2018-02-04T22:02:01.000Z | src/communication/__init__.py | FrancoisChastel/DD2480_Software-Engineering_CI | 26424af8a349cc0abdc9a256bf91b161d989c702 | [
"BSD-2-Clause"
] | 4 | 2018-02-04T13:43:40.000Z | 2018-02-07T00:25:33.000Z | src/communication/__init__.py | FrancoisChastel/DD2480_Software-Engineering_CI | 26424af8a349cc0abdc9a256bf91b161d989c702 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
| 22.2 | 32 | 0.738739 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from communication import Result
from communication import State
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 21 | 44 |
0207817264fb7982ec6cde128f051f60e24326a9 | 1,966 | py | Python | eqapi.py | coolhva/eqapi | b3c9f7363690e053d6650ec1cc52f651908795d0 | [
"BSD-3-Clause"
] | null | null | null | eqapi.py | coolhva/eqapi | b3c9f7363690e053d6650ec1cc52f651908795d0 | [
"BSD-3-Clause"
] | null | null | null | eqapi.py | coolhva/eqapi | b3c9f7363690e053d6650ec1cc52f651908795d0 | [
"BSD-3-Clause"
] | null | null | null | """Email.Cloud Queue Management
This application allows you to manage the queue of Email.Cloud through a
webapplication.
Author: henk.vanachterberg@broadcom.com
"""
from app import create_app
app = create_app()
| 32.229508 | 72 | 0.711089 | """Email.Cloud Queue Management
This application allows you to manage the queue of Email.Cloud through a
webapplication.
Author: henk.vanachterberg@broadcom.com
"""
from app import create_app, db
from app.models import GlobalQueue, DomainQueue
from app.api import queryQueue
from random import randrange
app = create_... | 0 | 1,568 | 0 | 0 | 0 | 0 | 0 | 46 | 135 |
459d3133cd1f87769f52f6e4ad99deebfe8fce6b | 1,875 | py | Python | applications/tensorflow/detection/yolov3/tests/test_upsample.py | kew96/GraphcoreExamples | 22dc0d7e3755b0a7f16cdf694c6d10c0f91ee8eb | [
"MIT"
] | null | null | null | applications/tensorflow/detection/yolov3/tests/test_upsample.py | kew96/GraphcoreExamples | 22dc0d7e3755b0a7f16cdf694c6d10c0f91ee8eb | [
"MIT"
] | null | null | null | applications/tensorflow/detection/yolov3/tests/test_upsample.py | kew96/GraphcoreExamples | 22dc0d7e3755b0a7f16cdf694c6d10c0f91ee8eb | [
"MIT"
] | null | null | null | # Copyright (c) 2020 Graphcore Ltd. 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 l... | 32.894737 | 105 | 0.7376 | # Copyright (c) 2020 Graphcore Ltd. 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 l... | 0 | 897 | 0 | 0 | 0 | 0 | 0 | 40 | 156 |
5c1a2bd33e2a6cbc00786a81656574dc9a97921b | 1,313 | py | Python | setup.py | octomike/sp_experiment | 4d19df94824aee4ceccf7c2c3386738f8b8687c8 | [
"BSD-3-Clause"
] | null | null | null | setup.py | octomike/sp_experiment | 4d19df94824aee4ceccf7c2c3386738f8b8687c8 | [
"BSD-3-Clause"
] | null | null | null | setup.py | octomike/sp_experiment | 4d19df94824aee4ceccf7c2c3386738f8b8687c8 | [
"BSD-3-Clause"
] | null | null | null | """Setup the package."""
import os
from setuptools import setup, find_packages
# get the version
version = None
with open(os.path.join('sp_experiment', '__init__.py'), 'r') as fid:
for line in (line.strip() for line in fid):
if line.startswith('__version__'):
version = line.split('=')[1].strip(... | 26.26 | 71 | 0.60396 | """Setup the package."""
import os
from setuptools import setup, find_packages
# get the version
version = None
with open(os.path.join('sp_experiment', '__init__.py'), 'r') as fid:
for line in (line.strip() for line in fid):
if line.startswith('__version__'):
version = line.split('=')[1].strip(... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6a6033d2ca5b77af297c80379ef1ef8404ade9ae | 5,276 | py | Python | utils/capac_controller.py | Czworldy/GP | 2a9cfb2dca0252516a44fd174b839e8f9b384a26 | [
"MIT"
] | null | null | null | utils/capac_controller.py | Czworldy/GP | 2a9cfb2dca0252516a44fd174b839e8f9b384a26 | [
"MIT"
] | null | null | null | utils/capac_controller.py | Czworldy/GP | 2a9cfb2dca0252516a44fd174b839e8f9b384a26 | [
"MIT"
] | null | null | null | import carla_utils as cu
import time
if __name__ == "__main__":
client, world, town_map = cu.connect_to_server('127.0.0.1', 2000, timeout=2.0, map_name='None')
vehicle = cu.get_actor(world, 'vehicle.bh.crossbike', 'hero')
c = CapacController(vehicle, 10)
trajectory = {'time':1, 'x':1, 'y':1... | 31.404762 | 120 | 0.564443 | import carla_utils as cu
import time
import numpy as np
import carla
class Param(object):
def __init__(self):
'''vehicle'''
self.L = 2.405
self.max_acceleration = 1.0
self.min_acceleration = -1.0
self.max_steer = 1.0
'''PID'''
self.v_pid_Kp = 1.00#1.00
... | 0 | 0 | 0 | 4,745 | 0 | 0 | 0 | -12 | 90 |
0a16df5eaff992471e697726f59f4619dfd42328 | 1,487 | py | Python | tests/src/test_voronoi.py | codethechange/mobility_pipeline | 4c5cd125c015670cddd9698142460286088a9b12 | [
"BSD-3-Clause"
] | null | null | null | tests/src/test_voronoi.py | codethechange/mobility_pipeline | 4c5cd125c015670cddd9698142460286088a9b12 | [
"BSD-3-Clause"
] | 31 | 2019-04-07T17:08:53.000Z | 2020-02-04T03:10:30.000Z | tests/src/test_voronoi.py | codethechange/mobility_pipeline | 4c5cd125c015670cddd9698142460286088a9b12 | [
"BSD-3-Clause"
] | null | null | null | # pragma pylint: disable=missing-docstring
| 25.20339 | 80 | 0.437122 | # pragma pylint: disable=missing-docstring
import json
from shapely.geometry import Point
from mobility_pipeline.lib.voronoi import load_cell
def test_load_cell_polygon():
voronoi_json = """
{
"type": "Polygon",
"coordinates": [
[
[-5, -5],
[-5, 0],... | 0 | 0 | 0 | 0 | 0 | 1,296 | 0 | 33 | 113 |
5b7447b8797d8dd4e91a0c9fcb03e39ffa480b55 | 6,626 | py | Python | model/tacotron_integrate/attention.py | samirsahoo007/ZeroSpeech-TTS-without-T | 54439fdcebaac0041fe6a527c00747f9b86c199d | [
"MIT"
] | 20 | 2019-03-12T09:46:47.000Z | 2021-12-21T09:02:56.000Z | model/tacotron_integrate/attention.py | samirsahoo007/ZeroSpeech-TTS-without-T | 54439fdcebaac0041fe6a527c00747f9b86c199d | [
"MIT"
] | 1 | 2019-02-27T10:11:08.000Z | 2019-02-27T10:11:08.000Z | model/tacotron_integrate/attention.py | samirsahoo007/ZeroSpeech-TTS-without-T | 54439fdcebaac0041fe6a527c00747f9b86c199d | [
"MIT"
] | 13 | 2019-03-29T09:25:10.000Z | 2022-02-06T14:15:04.000Z | # -*- coding: utf-8 -*- #
"""*********************************************************************************************"""
# FileName [ attention.py ]
# Synopsis [ Sequence to sequence attention module for Tacotron ]
# Author [ Ting-Wei Liu (Andi611) ]
# Copyright [ Copyleft(c), Speech Lab, ... | 29.580357 | 120 | 0.65575 | # -*- coding: utf-8 -*- #
"""*********************************************************************************************"""
# FileName [ attention.py ]
# Synopsis [ Sequence to sequence attention module for Tacotron ]
# Author [ Ting-Wei Liu (Andi611) ]
# Copyright [ Copyleft(c), Speech Lab, ... | 0 | 0 | 0 | 5,494 | 0 | 0 | 0 | 19 | 220 |
32b591016146378c44c56c9bb8ab636129717b88 | 5,843 | py | Python | src/tests/google/appengine/ext/mapreduce/mapreduce_pipeline.py | cooljeanius/cauliflowervest | a9bc209b610a927083bf16274d8451c6c45227bf | [
"Apache-2.0"
] | 1 | 2020-10-13T19:53:04.000Z | 2020-10-13T19:53:04.000Z | src/tests/google/appengine/ext/mapreduce/mapreduce_pipeline.py | cooljeanius/cauliflowervest | a9bc209b610a927083bf16274d8451c6c45227bf | [
"Apache-2.0"
] | null | null | null | src/tests/google/appengine/ext/mapreduce/mapreduce_pipeline.py | cooljeanius/cauliflowervest | a9bc209b610a927083bf16274d8451c6c45227bf | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2007 Google 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 o... | 28.783251 | 80 | 0.676365 | #!/usr/bin/env python
#
# Copyright 2007 Google 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 o... | 0 | 0 | 0 | 4,423 | 0 | 0 | 0 | 217 | 293 |
9db9ae8158c883d647f47b7fdb54a24e8632cdc7 | 154 | py | Python | python_ex/filter.py | rg3915/wttd2 | 1af607d6506360ff8a8c03bf9be2c5225a4d90cc | [
"MIT"
] | 6 | 2016-02-16T16:12:56.000Z | 2020-02-02T02:30:42.000Z | python_ex/filter.py | rg3915/wttd2 | 1af607d6506360ff8a8c03bf9be2c5225a4d90cc | [
"MIT"
] | 20 | 2015-12-23T06:03:23.000Z | 2022-02-10T10:46:18.000Z | python_ex/filter.py | rg3915/wttd2 | 1af607d6506360ff8a8c03bf9be2c5225a4d90cc | [
"MIT"
] | 4 | 2016-01-06T11:24:42.000Z | 2016-05-02T18:27:57.000Z |
filter(name__startswith='Re', age__lt=40, city__endswith='aulo')
| 25.666667 | 64 | 0.649351 | def filter(**lookups):
for k, v in lookups.items():
print(k.split('__'), v)
filter(name__startswith='Re', age__lt=40, city__endswith='aulo')
| 0 | 0 | 0 | 0 | 0 | 66 | 0 | 0 | 22 |
174e5ab5317a8d175b1dbb1215463279fc11ac4e | 3,761 | py | Python | galgebra/deprecated.py | waldyrious/galgebra | b5eb070340434d030dd737a5656fbf709538b0b1 | [
"BSD-3-Clause"
] | 151 | 2018-09-18T12:30:14.000Z | 2022-03-16T08:02:48.000Z | galgebra/deprecated.py | waldyrious/galgebra | b5eb070340434d030dd737a5656fbf709538b0b1 | [
"BSD-3-Clause"
] | 454 | 2018-09-19T01:42:30.000Z | 2022-01-18T14:02:00.000Z | galgebra/deprecated.py | waldyrious/galgebra | b5eb070340434d030dd737a5656fbf709538b0b1 | [
"BSD-3-Clause"
] | 30 | 2019-02-22T08:25:50.000Z | 2022-01-15T05:20:22.000Z | import warnings
# galgebra 0.5.0
warnings.warn(
"The `galgebra.deprecated` module is deprecated",
DeprecationWarning, stacklevel=2)
################################# MV class for backward compatibility ###################
| 38.377551 | 101 | 0.58309 | import warnings
from . import ga
from .mv import Mv
# galgebra 0.5.0
warnings.warn(
"The `galgebra.deprecated` module is deprecated",
DeprecationWarning, stacklevel=2)
################################# MV class for backward compatibility ###################
class MV(Mv):
""" A deprecated version of :cl... | 0 | 2,106 | 0 | 1,023 | 0 | 315 | 0 | -8 | 91 |
ca87ea48bffd18b1dd96b34b495b366727034364 | 1,409 | py | Python | intervention_system/tools/config/decrypt_config.py | ethanjli/pac-hand-hygiene-intervention | 5e0a8a76da4c1fd6f88d0f7eac9d0a4fed0fbe5d | [
"BSD-3-Clause"
] | null | null | null | intervention_system/tools/config/decrypt_config.py | ethanjli/pac-hand-hygiene-intervention | 5e0a8a76da4c1fd6f88d0f7eac9d0a4fed0fbe5d | [
"BSD-3-Clause"
] | null | null | null | intervention_system/tools/config/decrypt_config.py | ethanjli/pac-hand-hygiene-intervention | 5e0a8a76da4c1fd6f88d0f7eac9d0a4fed0fbe5d | [
"BSD-3-Clause"
] | null | null | null | """Decrypt the keys of a settings JSON file."""
import argparse
import os
from intervention_system.deploy import settings_key_path as default_keyfile_path
from intervention_system.deploy import client_config_cipher_path as default_input_path
from intervention_system.deploy import client_configs_path
from intervention_... | 40.257143 | 101 | 0.753016 | """Decrypt the keys of a settings JSON file."""
import argparse
import os
from intervention_system.deploy import settings_key_path as default_keyfile_path
from intervention_system.deploy import client_config_cipher_path as default_input_path
from intervention_system.deploy import client_configs_path
from intervention_... | 0 | 0 | 0 | 0 | 0 | 139 | 0 | 22 | 45 |
6d34d5b9607448ac94c7960647d684c0979736f6 | 1,948 | py | Python | snapcastr/snapcastrd.py | xkonni/snapcastr | 73ac7188448072733f93cefb853f71fa837ab3bb | [
"MIT"
] | 39 | 2017-12-18T08:17:11.000Z | 2022-02-16T15:15:17.000Z | snapcastr/snapcastrd.py | xkonni/snapcastr | 73ac7188448072733f93cefb853f71fa837ab3bb | [
"MIT"
] | 14 | 2018-01-24T20:35:33.000Z | 2020-04-15T11:18:17.000Z | snapcastr/snapcastrd.py | xkonni/snapcastr | 73ac7188448072733f93cefb853f71fa837ab3bb | [
"MIT"
] | 13 | 2018-01-24T20:57:45.000Z | 2021-06-03T01:03:01.000Z | from xdg import XDG_CONFIG_HOME
CONFIG_FILE = f"{XDG_CONFIG_HOME}/snapcastr.json"
HOST="0.0.0.0"
PORT=5000
SC_HOST="localhost"
if __name__ == "__main__":
main()
| 28.231884 | 93 | 0.63039 | import argparse
import json
import os
from snapcastr.snapcastr import Snapcastr
from xdg import XDG_CONFIG_HOME
CONFIG_FILE = f"{XDG_CONFIG_HOME}/snapcastr.json"
HOST="0.0.0.0"
PORT=5000
SC_HOST="localhost"
def setup():
parser = argparse.ArgumentParser(description='snapcastr')
parser.add_argument('--host', me... | 0 | 0 | 0 | 0 | 0 | 1,655 | 0 | -8 | 134 |
643451eca07e2dd0fe2b7f43cc0e410b6fef0191 | 817 | py | Python | Common/run_all.py | RENCI-AUTOMAT/Data_services | eb60f822021b138298eabb3852b20b30739afaa5 | [
"MIT"
] | 2 | 2022-02-01T04:10:30.000Z | 2022-03-23T22:01:35.000Z | Common/run_all.py | RENCI-AUTOMAT/Data_services | eb60f822021b138298eabb3852b20b30739afaa5 | [
"MIT"
] | 83 | 2020-08-18T16:09:43.000Z | 2022-03-25T19:17:25.000Z | Common/run_all.py | RENCI-AUTOMAT/Data_services | eb60f822021b138298eabb3852b20b30739afaa5 | [
"MIT"
] | null | null | null |
import argparse
import os
from Common.load_manager import SourceDataLoadManager
from Common.build_manager import GraphBuilder
if __name__ == '__main__':
parser = argparse.ArgumentParser(description="Transform data sources into KGX files. Build neo4j graphs.")
parser.add_argument('-t', '--test_mode', action='... | 34.041667 | 129 | 0.758874 |
import argparse
import os
from Common.load_manager import SourceDataLoadManager
from Common.build_manager import GraphBuilder
if __name__ == '__main__':
parser = argparse.ArgumentParser(description="Transform data sources into KGX files. Build neo4j graphs.")
parser.add_argument('-t', '--test_mode', action='... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2959221767c166fa404a312332c623e89d0fbc0a | 135 | py | Python | computer_science/data_structures/stack/deque_api.py | LeandroTk/Algorithms | 569ed68eba3eeff902f8078992099c28ce4d7cd6 | [
"MIT"
] | 205 | 2018-12-01T17:49:49.000Z | 2021-12-22T07:02:27.000Z | computer_science/data_structures/stack/deque_api.py | LeandroTk/Algorithms | 569ed68eba3eeff902f8078992099c28ce4d7cd6 | [
"MIT"
] | 2 | 2020-01-01T16:34:29.000Z | 2020-04-26T19:11:13.000Z | computer_science/data_structures/stack/deque_api.py | LeandroTk/Algorithms | 569ed68eba3eeff902f8078992099c28ce4d7cd6 | [
"MIT"
] | 50 | 2018-11-28T20:51:36.000Z | 2021-11-29T04:08:25.000Z | from collections import deque
q = deque()
q.append(1)
q.append(2)
q.append(3)
print(q)
print(q.pop())
print(q.pop())
print(q.pop())
| 10.384615 | 29 | 0.659259 | from collections import deque
q = deque()
q.append(1)
q.append(2)
q.append(3)
print(q)
print(q.pop())
print(q.pop())
print(q.pop())
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9fb10bed43db7b1587a75fe757ff5f98819dc1d3 | 1,836 | py | Python | Strings/longest_common_prefix.py | techsavvyy/coding-problems | 84c6c8b5955ccd03e231a4fe6d2b82c3bbdf6e81 | [
"MIT"
] | 2,647 | 2019-12-16T13:52:07.000Z | 2022-03-31T08:38:35.000Z | Strings/longest_common_prefix.py | thebeastadi/coding-problems | 62b8da6bb99a564bec33b7864a61122b7bab8df0 | [
"MIT"
] | 16 | 2019-12-16T17:06:17.000Z | 2022-03-24T18:08:06.000Z | Strings/longest_common_prefix.py | thebeastadi/coding-problems | 62b8da6bb99a564bec33b7864a61122b7bab8df0 | [
"MIT"
] | 556 | 2019-12-16T14:05:05.000Z | 2022-03-31T02:41:34.000Z | '''
Longest Common Prefix
Write a function to find the longest common prefix string amongst an array of strings.
If there is no common prefix, return an empty string ''.
Input: ['flower', 'flow', 'flight']
Output: 'fl'
Input: ['dog', 'racecar', 'car']
Output: ''
Input: ['aa', 'a']
Output: 'a'
=====================... | 24.810811 | 125 | 0.576253 | '''
Longest Common Prefix
Write a function to find the longest common prefix string amongst an array of strings.
If there is no common prefix, return an empty string ''.
Input: ['flower', 'flow', 'flight']
Output: 'fl'
Input: ['dog', 'racecar', 'car']
Output: ''
Input: ['aa', 'a']
Output: 'a'
=====================... | 0 | 0 | 0 | 0 | 0 | 769 | 0 | 0 | 23 |
2d1928e2c9bdd67e42c5ec8a7260067f333ab3bc | 5,927 | py | Python | setup.py | ondratu/falias | 6b2a3bc41d9cbc247df7044fd5442085f93e9ddb | [
"BSD-3-Clause"
] | null | null | null | setup.py | ondratu/falias | 6b2a3bc41d9cbc247df7044fd5442085f93e9ddb | [
"BSD-3-Clause"
] | null | null | null | setup.py | ondratu/falias | 6b2a3bc41d9cbc247df7044fd5442085f93e9ddb | [
"BSD-3-Clause"
] | null | null | null | from distutils.core import setup
from os import environ
from sys import version_info
if version_info[0] >= 3:
from io import FileIO
file = FileIO
from falias import __version__
environ.update({'PYTHONPATH': 'falias'})
kwargs = {
'name': "Falias",
'version': __version__,
... | 32.565934 | 77 | 0.569765 | from distutils.core import setup, Command
from distutils.command.install_data import install_data
from distutils.dir_util import remove_tree
from distutils import log
from os import path, makedirs, walk, environ
from shutil import copyfile
from subprocess import call
from sys import version_info
if version_info[0] >=... | 0 | 0 | 0 | 3,516 | 0 | 505 | 0 | 102 | 248 |
b7a86223cc9bc84d2d1b66205897e603c56b7f13 | 3,175 | py | Python | src/app2/cate.py | jack139/cnnc | c32611ec01af50bedb67dcd4c8a28e4b0c7a9aef | [
"BSD-2-Clause"
] | null | null | null | src/app2/cate.py | jack139/cnnc | c32611ec01af50bedb67dcd4c8a28e4b0c7a9aef | [
"BSD-2-Clause"
] | null | null | null | src/app2/cate.py | jack139/cnnc | c32611ec01af50bedb67dcd4c8a28e4b0c7a9aef | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
from config import setting
db = setting.db_web
#
url = ('/app2/category')
GEN_SIGN = {
0 : '',
1 : '',
2 : '',
3 : '',
4 : '',
}
# -------------------
| 30.528846 | 106 | 0.492913 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
import web
import json
from bson.objectid import ObjectId
from config import setting
import app_helper
db = setting.db_web
# 病种分类入口(根目录)
url = ('/app2/category')
GEN_SIGN = {
0 : '',
1 : '●',
2 : ' ►',
3 : ' ★',
4 : ' ◆',
}
def get_list(parent_... | 267 | 1,801 | 0 | -7 | 0 | 917 | 0 | -12 | 161 |
946e143f66c8eedff5da973175cf38e335f6608a | 2,368 | py | Python | mysite/joblist/views.py | jingluomaf/django-mysite | 5a106df6c18e7bd49e02cd29fa3dfe11b5c26ff5 | [
"MIT"
] | null | null | null | mysite/joblist/views.py | jingluomaf/django-mysite | 5a106df6c18e7bd49e02cd29fa3dfe11b5c26ff5 | [
"MIT"
] | 14 | 2020-06-05T22:51:09.000Z | 2022-03-12T00:03:07.000Z | mysite/joblist/views.py | jingluomaf/django-mysite | 5a106df6c18e7bd49e02cd29fa3dfe11b5c26ff5 | [
"MIT"
] | null | null | null |
# last = Job.objects.raw('SELECT * FROM joblist_job LIMIT 1')[0]
# jobtime = last.date
# print(jobtime)
# time = datetime.date.today()
# print(time)
# print(last.date == time)
| 34.823529 | 95 | 0.591216 | import bs4 as bs
import datetime
import urllib.request
from django.views.generic import ListView
from .models import Job
from django.shortcuts import render, redirect
class JobList(ListView):
model = Job
ordering = ['-date']
def isNone(variable):
if variable is not None:
return variable.get_text... | 0 | 0 | 0 | 44 | 0 | 1,907 | 0 | 35 | 201 |
df4cd142ea29c514dd5e88d3e9e19bc25ec83409 | 911 | py | Python | pyga/__init__.py | jorahn/gapy-tools | 60ce9e0926a8dab3df5280e4e62b5b4e02675c77 | [
"MIT"
] | null | null | null | pyga/__init__.py | jorahn/gapy-tools | 60ce9e0926a8dab3df5280e4e62b5b4e02675c77 | [
"MIT"
] | 5 | 2021-09-07T08:16:21.000Z | 2021-09-07T08:17:52.000Z | pyga/__init__.py | jorahn/pyga | 60ce9e0926a8dab3df5280e4e62b5b4e02675c77 | [
"MIT"
] | null | null | null |
SCOPES = ['https://www.googleapis.com/auth/analytics.readonly']
| 36.44 | 72 | 0.605928 | from apiclient.discovery import build
from oauth2client.service_account import ServiceAccountCredentials
SCOPES = ['https://www.googleapis.com/auth/analytics.readonly']
class Client(object):
def __init__(self, credentials_path, ga_view_id):
sac = ServiceAccountCredentials.from_json_keyfile_name(
... | 0 | 0 | 0 | 718 | 0 | 0 | 0 | 61 | 67 |
97edc50aa290d68498f9a97992c3b2615ec35c47 | 1,069 | py | Python | Criminals/datasetCreator.py | DaveSoham08/CamRadar | 0a801445b060d17c27eed9153accd4d3f4f0ec18 | [
"MIT"
] | 3 | 2021-11-16T23:56:19.000Z | 2022-03-31T12:01:21.000Z | Criminals/datasetCreator.py | DaveSoham08/CamRadar | 0a801445b060d17c27eed9153accd4d3f4f0ec18 | [
"MIT"
] | 2 | 2020-10-01T10:08:35.000Z | 2020-10-15T09:52:31.000Z | Criminals/datasetCreator.py | DaveSoham08/CamRadar | 0a801445b060d17c27eed9153accd4d3f4f0ec18 | [
"MIT"
] | 4 | 2020-10-01T10:20:24.000Z | 2021-08-06T15:46:55.000Z | import cv2
import os
face_cascade = cv2.CascadeClassifier(cv2.data.haarcascades + 'haarcascade_frontalface_default.xml')
cam = cv2.VideoCapture(0)
id = input('enter Name: ')
createFolder('./'+str(id)+'/')
FaceCount=1
while(True):
ret,img = cam.read()
gray=cv2.cvtColor(img,cv2.COLOR_B... | 23.23913 | 99 | 0.613658 | import cv2
import os
face_cascade = cv2.CascadeClassifier(cv2.data.haarcascades + 'haarcascade_frontalface_default.xml')
cam = cv2.VideoCapture(0)
id = input('enter Name: ')
def createFolder(directory):
try:
if not os.path.exists(directory):
os.makedirs(directory)
except OSError:
... | 0 | 0 | 0 | 0 | 0 | 172 | 0 | 0 | 23 |
8258d599493da8993df7590f9b6a50103b24a974 | 17,343 | py | Python | axiom/drs/__init__.py | AusClimateService/axiom | 24678093065a4626549831086e4903e38f60fa81 | [
"MIT"
] | null | null | null | axiom/drs/__init__.py | AusClimateService/axiom | 24678093065a4626549831086e4903e38f60fa81 | [
"MIT"
] | 8 | 2022-03-16T12:08:12.000Z | 2022-03-29T03:17:47.000Z | axiom/drs/__init__.py | AusClimateService/axiom | 24678093065a4626549831086e4903e38f60fa81 | [
"MIT"
] | null | null | null | """Main entrypoint for DRS processing."""
import os
from datetime import datetime
from uuid import uuid4
import xarray as xr
import axiom.utilities as au
import axiom.drs.utilities as adu
from axiom.drs.domain import Domain
import axiom_schemas as axs
import json
import sys
from axiom.config import load_config
from axi... | 34.895372 | 149 | 0.655019 | """Main entrypoint for DRS processing."""
import os
import argparse
from datetime import datetime
from uuid import uuid4
import xarray as xr
import axiom.utilities as au
import axiom.drs.utilities as adu
from axiom.drs.domain import Domain
import axiom_schemas as axs
import json
import sys
from distributed import Clien... | 0 | 0 | 0 | 0 | 0 | 2,440 | 0 | 15 | 145 |
f773fcccc35ee41465b960a9d31de2665891d753 | 16,795 | py | Python | yandex/cloud/containerregistry/v1/repository_service_pb2.py | kbespalov/python-sdk | e86563ee850e46a35b4c84053ecd4affdf66a963 | [
"MIT"
] | null | null | null | yandex/cloud/containerregistry/v1/repository_service_pb2.py | kbespalov/python-sdk | e86563ee850e46a35b4c84053ecd4affdf66a963 | [
"MIT"
] | null | null | null | yandex/cloud/containerregistry/v1/repository_service_pb2.py | kbespalov/python-sdk | e86563ee850e46a35b4c84053ecd4affdf66a963 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: yandex/cloud/containerregistry/v1/repository_service.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import... | 53.148734 | 2,852 | 0.792141 | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: yandex/cloud/containerregistry/v1/repository_service.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
23839cfb3ef59b3fee3c12103323e7a4cd3c1750 | 4,507 | py | Python | pdseg/tools/jingling2seg.py | windstamp/PaddleSeg | 828808ea306adf2e8b94c291b77e7b7cf558bc2a | [
"ECL-2.0",
"Apache-2.0"
] | 56 | 2021-01-31T02:19:12.000Z | 2022-03-12T12:39:21.000Z | pdseg/tools/jingling2seg.py | windstamp/PaddleSeg | 828808ea306adf2e8b94c291b77e7b7cf558bc2a | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2021-07-21T02:36:01.000Z | 2021-07-21T02:37:45.000Z | pdseg/tools/jingling2seg.py | windstamp/PaddleSeg | 828808ea306adf2e8b94c291b77e7b7cf558bc2a | [
"ECL-2.0",
"Apache-2.0"
] | 13 | 2021-02-03T11:18:36.000Z | 2022-03-07T08:18:53.000Z | # coding: utf8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserve.
#
# 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 requ... | 35.769841 | 79 | 0.575327 | # coding: utf8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserve.
#
# 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 requ... | 0 | 0 | 0 | 0 | 0 | 3,534 | 0 | -5 | 246 |
6f6660d38febf7f7dcd610ea4ab528e6cbc433d9 | 675 | py | Python | planemo/commands/cmd_profile_create.py | gmauro/planemo | 574088f356a7b9f49191daf15437c2973c7318d8 | [
"CC-BY-3.0"
] | 73 | 2015-01-03T15:09:26.000Z | 2022-03-30T23:52:55.000Z | planemo/commands/cmd_profile_create.py | gmauro/planemo | 574088f356a7b9f49191daf15437c2973c7318d8 | [
"CC-BY-3.0"
] | 958 | 2015-01-02T08:27:45.000Z | 2022-03-23T14:51:51.000Z | planemo/commands/cmd_profile_create.py | gmauro/planemo | 574088f356a7b9f49191daf15437c2973c7318d8 | [
"CC-BY-3.0"
] | 84 | 2015-01-06T18:27:28.000Z | 2021-11-18T01:58:17.000Z | """Module describing the planemo ``profile_create`` command."""
from __future__ import print_function
| 28.125 | 63 | 0.78963 | """Module describing the planemo ``profile_create`` command."""
from __future__ import print_function
import click
from planemo import options
from planemo.cli import command_function
from planemo.galaxy import profiles
@click.command('profile_create')
@options.profile_name_argument()
@options.profile_database_opti... | 0 | 429 | 0 | 0 | 0 | 0 | 0 | 30 | 113 |
94bc87232d071ef45a48f22dec97aecb48383671 | 207 | py | Python | BOJ1920.py | INYEONGKIM/BOJ | 5e83d77a92d18b0d20d26645c7cfe4ba3e2d25bc | [
"MIT"
] | 2 | 2019-03-05T15:42:46.000Z | 2019-07-24T15:52:36.000Z | BOJ1920.py | INYEONGKIM/BOJ | 5e83d77a92d18b0d20d26645c7cfe4ba3e2d25bc | [
"MIT"
] | null | null | null | BOJ1920.py | INYEONGKIM/BOJ | 5e83d77a92d18b0d20d26645c7cfe4ba3e2d25bc | [
"MIT"
] | null | null | null | n=int(input());a=set(int(i) for i in input().split());x=int(input());b=[int(i) for i in input().split()];r=""
for i in range(x):
if b[i] in a:
r+="1\n"
else:
r+="0\n"
print(r,end="")
| 25.875 | 109 | 0.492754 | n=int(input());a=set(int(i) for i in input().split());x=int(input());b=[int(i) for i in input().split()];r=""
for i in range(x):
if b[i] in a:
r+="1\n"
else:
r+="0\n"
print(r,end="")
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
05d3a3fd5713f38eba2b7403a0888a87ccc57c67 | 4,465 | py | Python | edg_core/edgir/name_pb2.py | tengisd/PolymorphicBlocks | 240a11f813762c4eb5a97c9d9766a0af19cd8f3a | [
"BSD-3-Clause"
] | null | null | null | edg_core/edgir/name_pb2.py | tengisd/PolymorphicBlocks | 240a11f813762c4eb5a97c9d9766a0af19cd8f3a | [
"BSD-3-Clause"
] | null | null | null | edg_core/edgir/name_pb2.py | tengisd/PolymorphicBlocks | 240a11f813762c4eb5a97c9d9766a0af19cd8f3a | [
"BSD-3-Clause"
] | null | null | null | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: name.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflecti... | 33.571429 | 350 | 0.745577 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: name.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflecti... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4d65d97e660f59e6e5c059933d187036a99a95c3 | 2,544 | py | Python | L1Trigger/L1GctAnalyzer/test/gctLUTGenerator_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | L1Trigger/L1GctAnalyzer/test/gctLUTGenerator_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | L1Trigger/L1GctAnalyzer/test/gctLUTGenerator_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | from __future__ import print_function
import FWCore.ParameterSet.Config as cms
import sys
import os
# arguments
if (len(sys.argv)>1) :
key=str(sys.argv[2])
else :
key='Default'
print("Generating LUT files for GCT key %s" % (key))
if (not ("TNS_ADMIN" in os.environ.keys())):
print("Please set TNS_ADMIN u... | 31.8 | 91 | 0.795597 | from __future__ import print_function
import FWCore.ParameterSet.Config as cms
import sys
import os
# arguments
if (len(sys.argv)>1) :
key=str(sys.argv[2])
else :
key='Default'
print("Generating LUT files for GCT key %s" % (key))
if (not ("TNS_ADMIN" in os.environ.keys())):
print("Please set TNS_ADMIN u... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
688901152b667dc7976e5543f38c2819e523404e | 26,813 | py | Python | sdk/python/pulumi_equinix_metal/outputs.py | rawkode/pulumi-equinix-metal | 915d768709ced7d2caed563c1823302f378c4317 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_equinix_metal/outputs.py | rawkode/pulumi-equinix-metal | 915d768709ced7d2caed563c1823302f378c4317 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_equinix_metal/outputs.py | rawkode/pulumi-equinix-metal | 915d768709ced7d2caed563c1823302f378c4317 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import pulumi
__all__ = [
'DeviceIpAddress',
'DeviceNetwork',
'DevicePort',
'ProjectBgpConfig',
'SpotMarketRequestI... | 32.265945 | 225 | 0.601611 | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from . import _utilities... | 0 | 25,624 | 0 | 0 | 0 | 0 | 0 | 43 | 455 |
f4a948c6bd4758bab971081aa2c10e3df2792c0e | 4,594 | py | Python | kts/feature/decorators.py | alexander-ahappydandelion/kts_update_v1 | 016ca31b3cf9512730e31f475738e8150cc1ba01 | [
"MIT"
] | null | null | null | kts/feature/decorators.py | alexander-ahappydandelion/kts_update_v1 | 016ca31b3cf9512730e31f475738e8150cc1ba01 | [
"MIT"
] | null | null | null | kts/feature/decorators.py | alexander-ahappydandelion/kts_update_v1 | 016ca31b3cf9512730e31f475738e8150cc1ba01 | [
"MIT"
] | null | null | null | from ..storage import source_utils
from ..storage.caching import cache
from .. import config
def preview(df, sizes=(2, 4, 6)):
"""
Applies function to heads of particular dataframe.
Example:
``` python
@preview(df, sizes=[5, 15])
def make_ohe_pclass(df):
...
```
"""
r... | 29.075949 | 138 | 0.627993 | from ..storage import source_utils
from ..storage.caching import cache
from .. import config
from .storage import FeatureConstructor
from ..storage import dataframe
from IPython.display import display
from glob import glob
import os
def preview(df, sizes=(2, 4, 6)):
"""
Applies function to heads of particular... | 0 | 0 | 0 | 0 | 0 | 1,128 | 0 | 30 | 164 |
18349715cf8def25c13f26d2c461059197972efe | 473 | py | Python | CalibCalorimetry/HcalAlgos/test/HcalPulseContainmentTest_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | CalibCalorimetry/HcalAlgos/test/HcalPulseContainmentTest_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | CalibCalorimetry/HcalAlgos/test/HcalPulseContainmentTest_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
process = cms.Process("Test")
process.load("Configuration.StandardSequences.Services_cff")
process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
process.source = cms.Source("EmptySource")
process.maxEvents = cms.untracked.PSet(
input = cms.untr... | 27.823529 | 80 | 0.813953 | import FWCore.ParameterSet.Config as cms
process = cms.Process("Test")
process.load("Configuration.StandardSequences.Services_cff")
process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
process.source = cms.Source("EmptySource")
process.maxEvents = cms.untracked.PSet(
input = cms.untr... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1b3d6434b2a95decaf3d4646b6d28abd9ee7d364 | 1,745 | py | Python | select_workload.py | tverona1/yb-workload-runner | 6a2200320394f7138ee279842ad0ffb3bcafb98c | [
"Apache-2.0"
] | null | null | null | select_workload.py | tverona1/yb-workload-runner | 6a2200320394f7138ee279842ad0ffb3bcafb98c | [
"Apache-2.0"
] | null | null | null | select_workload.py | tverona1/yb-workload-runner | 6a2200320394f7138ee279842ad0ffb3bcafb98c | [
"Apache-2.0"
] | null | null | null |
""" A simple workload that selects single rows
""" | 36.354167 | 143 | 0.66361 | import logging
import random
from common.timing_wrapper import TimingWrapper
from locust import User, task, between
from common.workload_config import workload_config
""" A simple workload that selects single rows
"""
class SelectWorkload(User):
def __init__(self, environment):
super().__init__(environment... | 0 | 1,106 | 0 | 399 | 0 | 0 | 0 | 57 | 132 |
503acad9c4788c75353acb9d062054aeba556e78 | 7,922 | py | Python | mathutils/test_xform.py | saridut/FloriPy | 0117d358b9c2362ea32ecf9ec719fdaed87d3e14 | [
"MIT"
] | null | null | null | mathutils/test_xform.py | saridut/FloriPy | 0117d358b9c2362ea32ecf9ec719fdaed87d3e14 | [
"MIT"
] | null | null | null | mathutils/test_xform.py | saridut/FloriPy | 0117d358b9c2362ea32ecf9ec719fdaed87d3e14 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
if __name__ == '__main__':
test_axis_angle_conversion()
test_quat_conversion()
test_euler_conversion()
test_dcm_conversion()
test_rot_shift_axis_angle()
test_rot_shift_quat()
test_rot_shift_euler()
test_intra_euler()
| 28.599278 | 81 | 0.502903 | #!/usr/bin/env python
import math
import numpy as np
from xform import *
def test_axis_angle_conversion():
print('=====================')
print('axis-angle conversion')
print('=====================')
axes = []; angles = []
axis, angle = get_rand_axis_angle()
axes.append(axis)
angles.append... | 0 | 0 | 0 | 0 | 0 | 7,353 | 0 | -15 | 300 |
b3c56f3909af7b042f22cd805a456756f75de739 | 4,393 | py | Python | 16.py | mguenther/advent-of-code-2020 | 6aeb6f80401963b25444d3a9b6e970e28d1ffa37 | [
"Apache-2.0"
] | null | null | null | 16.py | mguenther/advent-of-code-2020 | 6aeb6f80401963b25444d3a9b6e970e28d1ffa37 | [
"Apache-2.0"
] | null | null | null | 16.py | mguenther/advent-of-code-2020 | 6aeb6f80401963b25444d3a9b6e970e28d1ffa37 | [
"Apache-2.0"
] | null | null | null | from functools import reduce
constraints, my_ticket, nearby_tickets = parse('16.in')
valid_nearby_tickets = []
invalid_number_per_ticket = []
for nearby_ticket in nearby_tickets:
invalid_ticket = False
for number in nearby_ticket:
at_least_one_is_valid = False
for constraint in con... | 35.715447 | 123 | 0.667425 | from functools import reduce
from typing import Callable, Dict, List, Tuple
def parse_constraints(parser_mode: int) -> bool:
return bool((parser_mode >> 0) & 1)
def parse_my_ticket(parser_mode: int) -> bool:
return bool((parser_mode >> 1) & 1)
def parse_nearby_tickets(parser_mode: int) -> bool:
return... | 0 | 0 | 0 | 0 | 0 | 3,137 | 0 | 25 | 275 |
60d9324b51a93e713fc4c8723c28d7e34049d443 | 4,303 | py | Python | src/hangar/dataloaders/common.py | dxenonb/hangar-py | a47aaf0ab69333e5d2629b231e0f9b4ca835c801 | [
"Apache-2.0"
] | null | null | null | src/hangar/dataloaders/common.py | dxenonb/hangar-py | a47aaf0ab69333e5d2629b231e0f9b4ca835c801 | [
"Apache-2.0"
] | null | null | null | src/hangar/dataloaders/common.py | dxenonb/hangar-py | a47aaf0ab69333e5d2629b231e0f9b4ca835c801 | [
"Apache-2.0"
] | null | null | null | from typing import Iterable, Union
ArraysetsRef = Union['ArraysetDataReader', Iterable['ArraysetDataReader']]
| 36.777778 | 93 | 0.6033 | import warnings
from typing import Iterable, Optional, Union, Tuple, List
ArraysetsRef = Union['ArraysetDataReader', Iterable['ArraysetDataReader']]
class GroupedAsets(object):
"""Groups hangar arraysets and validate suitability for usage in dataloaders.
It can choose a subset of samples in the hangar arra... | 0 | 53 | 0 | 4,075 | 0 | 0 | 0 | 17 | 45 |
e42c5a2d9bff86beb6eecd5c7cdacb2c52adebb8 | 7,017 | py | Python | classify.py | arturx-ml/mushrooms-classification | 8491c5d5f2d87b9e80388e64ab6d4e135199a478 | [
"Apache-2.0",
"MIT"
] | null | null | null | classify.py | arturx-ml/mushrooms-classification | 8491c5d5f2d87b9e80388e64ab6d4e135199a478 | [
"Apache-2.0",
"MIT"
] | null | null | null | classify.py | arturx-ml/mushrooms-classification | 8491c5d5f2d87b9e80388e64ab6d4e135199a478 | [
"Apache-2.0",
"MIT"
] | null | null | null | import torch
import warnings
warnings.filterwarnings('ignore')
DEBUG = False
BATCH_SIZE = 64
NUM_CLASSES = 39
data_dir = './images'
trainloader, testloader = load_split_train_test(data_dir, .2)
print(trainloader.dataset.classes)
print(len(trainloader.dataset.classes))
device = torch.device('cuda' if torch.cuda.i... | 33.574163 | 120 | 0.587573 | import matplotlib.pyplot as plt
import torch
import torchvision
import numpy as np
from torch import nn
from torch import optim
import torch.nn.functional as F
from torchvision import datasets, transforms, models
from torch.utils.data.sampler import SubsetRandomSampler
import warnings
warnings.filterwarnings('ignore')... | 0 | 0 | 0 | 1,549 | 0 | 3,267 | 0 | 81 | 314 |
529ee3dde960d602ad756f8ede0f45c55d2fdcbd | 2,549 | py | Python | tests/firedrake_backend/test_assemble.py | Naruki-Ichihara/fecr | 5d183f8a316e95fe05ea56a8cc6a16209f471b0d | [
"MIT"
] | 5 | 2020-10-31T10:54:24.000Z | 2021-02-26T12:16:02.000Z | tests/firedrake_backend/test_assemble.py | Naruki-Ichihara/fecr | 5d183f8a316e95fe05ea56a8cc6a16209f471b0d | [
"MIT"
] | 2 | 2020-11-11T15:00:34.000Z | 2021-01-12T20:30:55.000Z | tests/firedrake_backend/test_assemble.py | Naruki-Ichihara/fecr | 5d183f8a316e95fe05ea56a8cc6a16209f471b0d | [
"MIT"
] | 1 | 2022-01-05T14:10:57.000Z | 2022-01-05T14:10:57.000Z | import numpy as np
import firedrake
from fecr import evaluate_primal
mesh = firedrake.UnitSquareMesh(3, 2)
V = firedrake.FunctionSpace(mesh, "P", 1)
templates = (firedrake.Function(V), firedrake.Constant(0.0), firedrake.Constant(0.0))
inputs = (np.ones(V.dim()), np.ones(1) * 0.5, np.ones(1) * 0.6)
ff = lambda *a... | 31.469136 | 87 | 0.693213 | from pytest_check import check
import numpy as np
import firedrake
import firedrake_adjoint
import ufl
import fdm
from fecr import evaluate_primal, evaluate_pullback, evaluate_pushforward
mesh = firedrake.UnitSquareMesh(3, 2)
V = firedrake.FunctionSpace(mesh, "P", 1)
def assemble_firedrake(u, kappa0, kappa1):
... | 0 | 0 | 0 | 0 | 0 | 1,758 | 0 | 31 | 181 |
a3ad09b9004548f4bfa2e08739934e7dd51fa329 | 973 | py | Python | codes/20190106/src/test.py | ryoichiro3816/testpy | 3442a3a0281a15d899b0a0b978ea8783f69e3d7b | [
"MIT"
] | 4 | 2020-05-09T22:24:19.000Z | 2021-11-17T02:11:22.000Z | codes/20190106/src/test.py | ryoichiro3816/testpy | 3442a3a0281a15d899b0a0b978ea8783f69e3d7b | [
"MIT"
] | null | null | null | codes/20190106/src/test.py | ryoichiro3816/testpy | 3442a3a0281a15d899b0a0b978ea8783f69e3d7b | [
"MIT"
] | 13 | 2018-02-05T17:36:14.000Z | 2022-03-04T15:26:15.000Z | # coding: utf-8
from PIL import Image
import sys
import pyocr
import pyocr.builders
import os
from tqdm import trange
# Set Netflix subtitle image directory.
img_dir = '../data/planetes/PLANETES.S01E02.WEBRip.Netflix/'
#img_dir = '../data/'
# Get a tool.
tools = pyocr.get_available_tools()
if len(tools) == 0:
print(... | 23.166667 | 83 | 0.694758 | # coding: utf-8
from PIL import Image
import sys
import pyocr
import pyocr.builders
import os
from tqdm import trange
# Set Netflix subtitle image directory.
img_dir = '../data/planetes/PLANETES.S01E02.WEBRip.Netflix/'
#img_dir = '../data/'
# Get a tool.
tools = pyocr.get_available_tools()
if len(tools) == 0:
print(... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6f49e02d2b15ebe518394fc9be8873a7f052a93a | 9,288 | py | Python | socialregistration/views.py | nsmgr8/aep-django-socialregistration | 2ffc25afe841892ba487fcb0e532336b2d21480e | [
"MIT"
] | 1 | 2015-11-06T01:09:35.000Z | 2015-11-06T01:09:35.000Z | socialregistration/views.py | nsmgr8/aep-django-socialregistration | 2ffc25afe841892ba487fcb0e532336b2d21480e | [
"MIT"
] | null | null | null | socialregistration/views.py | nsmgr8/aep-django-socialregistration | 2ffc25afe841892ba487fcb0e532336b2d21480e | [
"MIT"
] | null | null | null | """
Created on 22.09.2009
@author: alen
"""
import uuid
# from oauth import oauth # not used
from django.conf import settings
from django.template import RequestContext
from django.core.urlresolvers import reverse
from django.shortcuts import render_to_response
from django.utils.translation import gettext as _
# from... | 33.774545 | 102 | 0.673342 | """
Created on 22.09.2009
@author: alen
"""
import uuid
# from oauth import oauth # not used
from django.conf import settings
from django.template import RequestContext
from django.core.urlresolvers import reverse
from django.shortcuts import render_to_response
from django.utils.translation import gettext as _
# from... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 22 | 0 |
b0034c312c4cd987c207b73234671ccc4411bde1 | 6,690 | py | Python | test/kullback_leibler_divergence.py | nearj/mpvr-motionfiltering | 478304391e031a11bd15a604a272017ce8e48abf | [
"MIT"
] | null | null | null | test/kullback_leibler_divergence.py | nearj/mpvr-motionfiltering | 478304391e031a11bd15a604a272017ce8e48abf | [
"MIT"
] | null | null | null | test/kullback_leibler_divergence.py | nearj/mpvr-motionfiltering | 478304391e031a11bd15a604a272017ce8e48abf | [
"MIT"
] | 1 | 2019-07-14T01:32:04.000Z | 2019-07-14T01:32:04.000Z | import matplotlib
matplotlib.use("TkAgg")
from matplotlib import pyplot as plt
LOAD_MOTION_DIR = './data/preprocessed/motion/'
LOAD_PROB_DIST = 'prob_dist/'
LOAD_CUMUL_DIST = 'cumul_dist/'
LOAD_COMPACT = 'compact/'
LOAD_VIDEO_DIR = './data/preprocessed/video/'
SAVE_DIR = './data/processed/'
SAVE_TABLE_OPTION = 'tabl... | 31.408451 | 97 | 0.619581 | import numpy as np
import pandas as pd
import matplotlib
matplotlib.use("TkAgg")
from matplotlib import pyplot as plt
import glob, os
LOAD_MOTION_DIR = './data/preprocessed/motion/'
LOAD_PROB_DIST = 'prob_dist/'
LOAD_CUMUL_DIST = 'cumul_dist/'
LOAD_COMPACT = 'compact/'
LOAD_VIDEO_DIR = './data/preprocessed/video/'
SA... | 0 | 0 | 0 | 0 | 0 | 4,416 | 0 | -11 | 343 |
935b90689b1d12cc34dcdb0a63b4db35de3afc2a | 3,276 | py | Python | Bugscan_exploits-master/exp_list/exp-596.py | csadsl/poc_exp | e3146262e7403f19f49ee2db56338fa3f8e119c9 | [
"MIT"
] | 11 | 2020-05-30T13:53:49.000Z | 2021-03-17T03:20:59.000Z | Bugscan_exploits-master/exp_list/exp-596.py | csadsl/poc_exp | e3146262e7403f19f49ee2db56338fa3f8e119c9 | [
"MIT"
] | 6 | 2020-05-13T03:25:18.000Z | 2020-07-21T06:24:16.000Z | Bugscan_exploits-master/exp_list/exp-596.py | csadsl/poc_exp | e3146262e7403f19f49ee2db56338fa3f8e119c9 | [
"MIT"
] | 6 | 2020-05-30T13:53:51.000Z | 2020-12-01T21:44:26.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#__author__ = 'Medici.Yan'
#Rsync
import socket, struct
def initialisation(host,port):
'''
,
'''
flag=False
s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
rsync={"MagicHeader":"@RSYNCD:","HeaderVersion":" 30.0"}
payload=struct.pack("!8s5ss",rsync... | 29.513514 | 111 | 0.659341 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#__author__ = 'Medici.Yan'
#Rsync弱口令检测
import socket,struct,hashlib,base64,time
def assign(service, arg):
if service == "rsync" and len(arg)==2:
return True, arg
def audit(arg):
host=arg[0]
port=arg[1]
res=initialisation(host, port)
if res[0]:
#securit... | 330 | 0 | 0 | 0 | 0 | 1,676 | 0 | 17 | 95 |
0824678638e2c900614c5636b1ea19007ec02511 | 890 | py | Python | python exercises/dek_program065.py | dek-odoo/python-samples | 0109d19e0aec3f40ea39973948d99657f7c27135 | [
"Apache-2.0"
] | 3 | 2015-01-30T07:06:26.000Z | 2020-08-04T05:09:23.000Z | python exercises/dek_program065.py | dek-odoo/python-samples | 0109d19e0aec3f40ea39973948d99657f7c27135 | [
"Apache-2.0"
] | null | null | null | python exercises/dek_program065.py | dek-odoo/python-samples | 0109d19e0aec3f40ea39973948d99657f7c27135 | [
"Apache-2.0"
] | 7 | 2017-06-15T23:27:48.000Z | 2021-12-28T17:34:16.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
#- Author : (DEK) Devendra Kavthekar
# program065:
# Write a program to compute:
# f(n)=f(n-1)+100 when n>0
# and f(0)=0
# with a given n input by console (n>0).
# Example:
# If the following n is given as input to the program:
# 5
# Then, the output of the p... | 20.697674 | 70 | 0.61573 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#- Author : (DEK) Devendra Kavthekar
# program065:
# Write a program to compute:
# f(n)=f(n-1)+100 when n>0
# and f(0)=0
# with a given n input by console (n>0).
# Example:
# If the following n is given as input to the program:
# 5
# Then, the output of the p... | 0 | 0 | 0 | 0 | 0 | 264 | 0 | 0 | 49 |
2d1e4311ee69635071cf22ac9474258ac1abe1f6 | 4,877 | py | Python | Samples/azure-storage/Azure.Python/storagemanagementclient/models/storage_account_properties.py | fhoering/autorest | b36c77ebb6a5c92aca72eea0894a683506af5817 | [
"MIT"
] | null | null | null | Samples/azure-storage/Azure.Python/storagemanagementclient/models/storage_account_properties.py | fhoering/autorest | b36c77ebb6a5c92aca72eea0894a683506af5817 | [
"MIT"
] | null | null | null | Samples/azure-storage/Azure.Python/storagemanagementclient/models/storage_account_properties.py | fhoering/autorest | b36c77ebb6a5c92aca72eea0894a683506af5817 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# --------------------------------------------------------------------------
| 55.420455 | 284 | 0.709042 | # coding=utf-8
# --------------------------------------------------------------------------
# --------------------------------------------------------------------------
from msrest.serialization import Model
class StorageAccountProperties(Model):
"""StorageAccountProperties.
:param provisioning_state: Gets ... | 0 | 0 | 0 | 4,644 | 0 | 0 | 0 | 17 | 46 |
e6a9ae50acd70f07f4d370e927c9c660c4fbc55b | 1,161 | py | Python | divide_conquer/week3/quicksort_last_pivot.py | liaoaoyuan97/standford_algorithms_specialization | 2914fdd397ce895d986ac855e78afd7a51ceff68 | [
"MIT"
] | null | null | null | divide_conquer/week3/quicksort_last_pivot.py | liaoaoyuan97/standford_algorithms_specialization | 2914fdd397ce895d986ac855e78afd7a51ceff68 | [
"MIT"
] | null | null | null | divide_conquer/week3/quicksort_last_pivot.py | liaoaoyuan97/standford_algorithms_specialization | 2914fdd397ce895d986ac855e78afd7a51ceff68 | [
"MIT"
] | 1 | 2021-01-18T19:35:48.000Z | 2021-01-18T19:35:48.000Z | from quicksort_first_pivot import read_input
if __name__ == "__main__":
input_arr = read_input('quicksort.txt')
cmp_cnt = quicksort_last_pivot(input_arr, 0, len(input_arr))
# print(input_arr)
print(cmp_cnt)
| 21.5 | 94 | 0.435831 | from quicksort_first_pivot import read_input
def quicksort_last_pivot(arr, l, r):
if (r - l) < 2:
return 0
t = arr[r - 1]
arr[r - 1] = arr[l]
arr[l] = t
p = arr[l]
i = l + 1
for j in range(l + 1, r):
if arr[j] < p:
t = arr[j]
arr[j] = arr[i]
... | 0 | 0 | 0 | 0 | 0 | 912 | 0 | 0 | 23 |
ce15c6c14c94e2dd9cfc31f90501724f9d7640a7 | 1,614 | py | Python | tests/test_spatial_methods.py | scotthavens/smrf | a492d01a5eef994e00728c1cbed9f693879bbade | [
"CC0-1.0"
] | null | null | null | tests/test_spatial_methods.py | scotthavens/smrf | a492d01a5eef994e00728c1cbed9f693879bbade | [
"CC0-1.0"
] | null | null | null | tests/test_spatial_methods.py | scotthavens/smrf | a492d01a5eef994e00728c1cbed9f693879bbade | [
"CC0-1.0"
] | null | null | null | # from copy import deepcopy
# from inicheck.tools import get_user_config, check_config, cast_all_variables
#
# from smrf.framework.model_framework import can_i_run_smrf
# from tests.test_configurations import SMRFTestCase
# class TestSpatialMethods(SMRFTestCase):
#
# def test_station_spatial_config(self):
# ... | 30.45283 | 78 | 0.623916 | # from copy import deepcopy
# from inicheck.tools import get_user_config, check_config, cast_all_variables
#
# from smrf.framework.model_framework import can_i_run_smrf
# from tests.test_configurations import SMRFTestCase
# class TestSpatialMethods(SMRFTestCase):
#
# def test_station_spatial_config(self):
# ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b971912aecb2966197acf17161c074e0b8736ab4 | 275 | py | Python | userena/__init__.py | juiceinc/django-userena | e4196c8b063576f432f2d7adf3c72a40a2764947 | [
"BSD-3-Clause"
] | 1 | 2021-09-22T04:11:35.000Z | 2021-09-22T04:11:35.000Z | userena/__init__.py | barszczmm/django-easy-userena | 096052d3e0c5ef0442d93fe90e1bd783f1c1dc7c | [
"BSD-3-Clause"
] | null | null | null | userena/__init__.py | barszczmm/django-easy-userena | 096052d3e0c5ef0442d93fe90e1bd783f1c1dc7c | [
"BSD-3-Clause"
] | null | null | null | """
Django accounts management made easy.
"""
VERSION = (1, 0, 2)
__version__ = '.'.join((str(each) for each in VERSION[:4]))
def get_version():
"""
Returns string with digit parts only as version.
"""
return '.'.join((str(each) for each in VERSION[:3]))
| 18.333333 | 59 | 0.614545 | """
Django accounts management made easy.
"""
VERSION = (1, 0, 2)
__version__ = '.'.join((str(each) for each in VERSION[:4]))
def get_version():
"""
Returns string with digit parts only as version.
"""
return '.'.join((str(each) for each in VERSION[:3]))
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c109934941f0b2791d9a4efb027f4f0d54cac01a | 4,036 | py | Python | invoiceminer/invoicedao.py | liuganghao/nodesmtp | 3c85676aad16fdd19accd1e3a8386a3f41252bb9 | [
"MIT-0"
] | null | null | null | invoiceminer/invoicedao.py | liuganghao/nodesmtp | 3c85676aad16fdd19accd1e3a8386a3f41252bb9 | [
"MIT-0"
] | null | null | null | invoiceminer/invoicedao.py | liuganghao/nodesmtp | 3c85676aad16fdd19accd1e3a8386a3f41252bb9 | [
"MIT-0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import mysql.connector
import config
dbconfig = {
'host': '127.0.0.1',
'port': 3306,
'database': 'invoicerepo2',
'user': 'invoicerepo',
'password': 'invoicerepo',
'charset': 'utf8',
'use_unicode': True,
'get_warnings': True
}
cnx = mysql.... | 35.716814 | 105 | 0.6167 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import mysql.connector
import config
dbconfig = {
'host': '127.0.0.1',
'port': 3306,
'database': 'invoicerepo2',
'user': 'invoicerepo',
'password': 'invoicerepo',
'charset': 'utf8',
'use_unicode': True,
'get_warnings': True
}
cnx = mysql.... | 84 | 0 | 0 | 0 | 0 | 3,368 | 0 | 0 | 110 |
49759fea86430f0cfc51820f9715fe2bd4887b2d | 171 | py | Python | anthill/__init__.py | ayushpallav/anthill | 740b8fce4281dfc4ca587c21a2d37741c649d870 | [
"MIT"
] | 14 | 2020-05-22T20:57:29.000Z | 2021-08-19T14:56:32.000Z | anthill/__init__.py | ayushpallav/apple-pie | 740b8fce4281dfc4ca587c21a2d37741c649d870 | [
"MIT"
] | 2 | 2021-01-04T05:05:08.000Z | 2021-01-04T05:11:08.000Z | anthill/__init__.py | ayushpallav/apple-pie | 740b8fce4281dfc4ca587c21a2d37741c649d870 | [
"MIT"
] | null | null | null |
from __future__ import absolute_import
from __future__ import unicode_literals
__author__ = """Ayush Pallav"""
__email__ = 'ayushpallav@gmail.com'
__version__ = '1.0.3'
| 21.375 | 39 | 0.783626 |
from __future__ import absolute_import
from __future__ import unicode_literals
__author__ = """Ayush Pallav"""
__email__ = 'ayushpallav@gmail.com'
__version__ = '1.0.3'
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
74a654504882bc60989d2a32491b49f99b5b35f3 | 868 | py | Python | Algorithms/2_Implementation/40.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | 1 | 2021-11-25T13:39:30.000Z | 2021-11-25T13:39:30.000Z | Algorithms/2_Implementation/40.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | null | null | null | Algorithms/2_Implementation/40.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | null | null | null | # https://www.hackerrank.com/challenges/non-divisible-subset/problem
#!/bin/python3
import os
#
# Complete the 'nonDivisibleSubset' function below.
#
# The function is expected to return an INTEGER.
# The function accepts following parameters:
# 1. INTEGER k
# 2. INTEGER_ARRAY s
#
if __name__ == '__main__':
fp... | 21.170732 | 70 | 0.650922 | # https://www.hackerrank.com/challenges/non-divisible-subset/problem
#!/bin/python3
import math
import os
import random
import re
import sys
#
# Complete the 'nonDivisibleSubset' function below.
#
# The function is expected to return an INTEGER.
# The function accepts following parameters:
# 1. INTEGER k
# 2. INTE... | 0 | 0 | 0 | 0 | 0 | 164 | 0 | -41 | 112 |
dc984ef3e325b532ac1b9c0476cd98b87ffc16ed | 137 | py | Python | orderdictbyvalue/ord.py | cassiobotaro/Rivendell | dcdb2543e42dea26dc07c9134d65b48f2c99bcc7 | [
"Apache-2.0"
] | 31 | 2018-01-07T21:25:07.000Z | 2021-06-18T13:30:43.000Z | orderdictbyvalue/ord.py | cassiobotaro/Rivendell | dcdb2543e42dea26dc07c9134d65b48f2c99bcc7 | [
"Apache-2.0"
] | 3 | 2018-01-10T12:08:42.000Z | 2020-03-31T01:12:46.000Z | orderdictbyvalue/ord.py | cassiobotaro/Rivendell | dcdb2543e42dea26dc07c9134d65b48f2c99bcc7 | [
"Apache-2.0"
] | 4 | 2018-01-10T02:27:04.000Z | 2019-08-15T19:38:03.000Z | from operator import itemgetter
original = {1: 2, 2: 3, 3: 1}
ordered = dict(sorted(original.items(), key=itemgetter(1)))
print(ordered)
| 27.4 | 59 | 0.715328 | from operator import itemgetter
original = {1: 2, 2: 3, 3: 1}
ordered = dict(sorted(original.items(), key=itemgetter(1)))
print(ordered)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b464ee281ecd92aaad1b1cf5e35eda916c2aedbd | 667 | py | Python | officials_expression.py | cbdb-project/SongMuZhiDataCleaning | ce4bace46ee62d7146acbb10f9470d09ad4aec7e | [
"MIT"
] | 1 | 2021-11-16T03:47:24.000Z | 2021-11-16T03:47:24.000Z | officials_expression.py | cbdb-project/SongMuZhiDataCleaning | ce4bace46ee62d7146acbb10f9470d09ad4aec7e | [
"MIT"
] | null | null | null | officials_expression.py | cbdb-project/SongMuZhiDataCleaning | ce4bace46ee62d7146acbb10f9470d09ad4aec7e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Create Time: 6/14/2021 4:16 PM
Author: Zhou
Generate the officials_list from officials.txt
"""
with open("officials.txt", encoding="utf-8") as file:
officials_raw = file.readlines()
officials_renew1 = []
print(officials_raw)
for item in officials_raw:
if "#" in ite... | 23 | 71 | 0.673163 | # -*- coding: utf-8 -*-
"""
Create Time: 6/14/2021 4:16 PM
Author: Zhou
Generate the officials_list from officials.txt
"""
with open("officials.txt", encoding="utf-8") as file:
officials_raw = file.readlines()
officials_renew1 = []
print(officials_raw)
for item in officials_raw:
if "#" in ite... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
be42d85a1b5860e44d6057829de7ec0f6f967523 | 14,959 | py | Python | omega/symbolic/orthotopes.py | tichakorn832/omega | 93aeda273dcd997b52921c48fd8813be6139b350 | [
"BSD-3-Clause"
] | null | null | null | omega/symbolic/orthotopes.py | tichakorn832/omega | 93aeda273dcd997b52921c48fd8813be6139b350 | [
"BSD-3-Clause"
] | null | null | null | omega/symbolic/orthotopes.py | tichakorn832/omega | 93aeda273dcd997b52921c48fd8813be6139b350 | [
"BSD-3-Clause"
] | null | null | null | """Boxes with integer size."""
# Copyright 2016-2018 by California Institute of Technology
# All rights reserved. Licensed under 3-clause BSD.
#
import logging
import natsort
from omega.logic import syntax as stx
from omega.symbolic.prime import support_issubset
from omega.symbolic.prime import joint_support
from ome... | 28.013109 | 64 | 0.539608 | """Boxes with integer size."""
# Copyright 2016-2018 by California Institute of Technology
# All rights reserved. Licensed under 3-clause BSD.
#
import logging
import natsort
from omega.logic import syntax as stx
from omega.symbolic.prime import support_issubset
from omega.symbolic.prime import joint_support
from ome... | 0 | 0 | 0 | 464 | 0 | 199 | 0 | 0 | 46 |
e0aeff9cc051f23b6ece16502afa9a2f2e1bf2be | 995 | py | Python | build/3rdparty_libraries.py | D15C0DE/openMSX | 5119a9657de4b82115c745f670cdc55dc7363133 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 320 | 2015-06-16T20:32:33.000Z | 2022-03-26T17:03:27.000Z | build/3rdparty_libraries.py | D15C0DE/openMSX | 5119a9657de4b82115c745f670cdc55dc7363133 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 2,592 | 2015-05-30T12:12:21.000Z | 2022-03-31T17:16:15.000Z | build/3rdparty_libraries.py | D15C0DE/openMSX | 5119a9657de4b82115c745f670cdc55dc7363133 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 74 | 2015-06-18T19:51:15.000Z | 2022-03-24T15:09:33.000Z | # Prints which 3rd party libraries are desired for the given configuration.
if __name__ == '__main__':
import sys
if len(sys.argv) == 3:
try:
main(*sys.argv[1 : ])
except ValueError as ex:
print(ex, file=sys.stderr)
sys.exit(2)
else:
print(
'Usage: python3 3rdparty_libraries.py TARGET_OS LINK_MODE... | 27.638889 | 75 | 0.770854 | # Prints which 3rd party libraries are desired for the given configuration.
from components import requiredLibrariesFor
from configurations import getConfiguration
from libraries import allDependencies, librariesByName
from packages import iterDownloadablePackages
def main(platform, linkMode):
configuration = getCon... | 0 | 0 | 0 | 0 | 0 | 421 | 0 | 101 | 112 |
6f3c6c29bd14593517ad65aa1fd30da1171747eb | 2,880 | py | Python | src/bxgateway/services/ont/abstract_ont_block_cleanup_service.py | doubleukay/bxgateway | ac01fc9475c039cf4255576dd4ecd6bff6c48f69 | [
"MIT"
] | 21 | 2019-11-06T17:37:41.000Z | 2022-03-28T07:18:33.000Z | src/bxgateway/services/ont/abstract_ont_block_cleanup_service.py | doubleukay/bxgateway | ac01fc9475c039cf4255576dd4ecd6bff6c48f69 | [
"MIT"
] | 4 | 2019-11-06T22:08:00.000Z | 2021-12-08T06:20:51.000Z | src/bxgateway/services/ont/abstract_ont_block_cleanup_service.py | doubleukay/bxgateway | ac01fc9475c039cf4255576dd4ecd6bff6c48f69 | [
"MIT"
] | 10 | 2020-08-05T15:58:16.000Z | 2022-02-07T23:51:10.000Z | from typing import TYPE_CHECKING
if TYPE_CHECKING:
from bxutils import logging
logger = logging.get_logger(__name__)
| 39.452055 | 112 | 0.720486 | import typing
from abc import abstractmethod
from typing import TYPE_CHECKING
from bxcommon.connections.connection_type import ConnectionType
from bxcommon.services.transaction_service import TransactionService
from bxcommon.utils.object_hash import Sha256Hash
from bxgateway.messages.ont.block_ont_message import Bloc... | 0 | 166 | 0 | 1,875 | 0 | 0 | 0 | 447 | 271 |
ae4388c0a308227c714bb8c4e6e9e5811f61ebb5 | 3,317 | py | Python | mot3d/utils/utils.py | cvlab-epfl/mot3d | 165f598d06f17b4960f327a1f0b850d70a73d910 | [
"Apache-2.0"
] | null | null | null | mot3d/utils/utils.py | cvlab-epfl/mot3d | 165f598d06f17b4960f327a1f0b850d70a73d910 | [
"Apache-2.0"
] | null | null | null | mot3d/utils/utils.py | cvlab-epfl/mot3d | 165f598d06f17b4960f327a1f0b850d70a73d910 | [
"Apache-2.0"
] | 1 | 2021-12-08T11:48:27.000Z | 2021-12-08T11:48:27.000Z | #----------------------------------------------------------------------------
# Created By : Leonardo Citraro leonardo.citraro@epfl.ch
# Date: 2021
# ---------------------------------------------------------------------------
import os
import re
__all__ = ["json_read", "json_write", "yaml_read", "yaml_write",
... | 32.519608 | 80 | 0.599337 | #----------------------------------------------------------------------------
# Created By : Leonardo Citraro leonardo.citraro@epfl.ch
# Date: 2021
# ---------------------------------------------------------------------------
import os
import sys
import json
import yaml
import re
import os
import ast
import glob
impor... | 0 | 0 | 0 | 0 | 0 | 2,190 | 0 | -75 | 457 |
3d09ffa107832b2fbe3544f46431e0d95b431d51 | 859 | py | Python | aids/strings/is_anagram.py | ueg1990/aids | bb543c6f53983d59edbc6a522ca10d64efd9c42e | [
"MIT"
] | null | null | null | aids/strings/is_anagram.py | ueg1990/aids | bb543c6f53983d59edbc6a522ca10d64efd9c42e | [
"MIT"
] | null | null | null | aids/strings/is_anagram.py | ueg1990/aids | bb543c6f53983d59edbc6a522ca10d64efd9c42e | [
"MIT"
] | null | null | null | '''
In this module, we determine if two given strings are anagrams
'''
def is_anagram_sort(string_1, string_2):
'''
Return True if the two given strings are anagrams using sorting
'''
return sorted(string_1) == sorted(string_2)
def is_anagram_counter(string_1, string_2):
'''
Return True if the two given strin... | 20.95122 | 68 | 0.704307 | '''
In this module, we determine if two given strings are anagrams
'''
def is_anagram_sort(string_1, string_2):
'''
Return True if the two given strings are anagrams using sorting
'''
return sorted(string_1) == sorted(string_2)
def is_anagram_counter(string_1, string_2):
'''
Return True if the two given strin... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
314f9d1b87c9289904fd8f8429fc473b648a99ee | 959 | py | Python | api/social/validators/social_account_generic_validator.py | marinimau/wayne_django_rest | eeaef0b9e3544c0f678b7f66684ac56f5ef90759 | [
"MIT"
] | null | null | null | api/social/validators/social_account_generic_validator.py | marinimau/wayne_django_rest | eeaef0b9e3544c0f678b7f66684ac56f5ef90759 | [
"MIT"
] | 5 | 2021-04-08T20:43:19.000Z | 2021-09-22T19:42:03.000Z | api/social/validators/social_account_generic_validator.py | marinimau/wayne_django_rest | eeaef0b9e3544c0f678b7f66684ac56f5ef90759 | [
"MIT"
] | null | null | null | #
# wayne_django_rest copyright 2020 - all rights reserved
# Created at: 28/10/2020
# By: mauromarini
# License: MIT
# Repository: https://github.com/marinimau/wayne_django_rest
# Credits: @marinimau (https://github.com/marinimau)
#
from contents.messages.get_messages import get_messages
from django.conf i... | 34.25 | 120 | 0.548488 | #
# wayne_django_rest copyright © 2020 - all rights reserved
# Created at: 28/10/2020
# By: mauromarini
# License: MIT
# Repository: https://github.com/marinimau/wayne_django_rest
# Credits: @marinimau (https://github.com/marinimau)
#
from rest_framework import serializers
from contents.messages.get_messag... | 2 | 0 | 0 | 0 | 0 | 235 | 0 | 17 | 45 |
517b324b875fed384a40c3be31d0514dbb7663d2 | 1,613 | py | Python | Question_21_30/codes/question27.py | uehir0/Gasyori100knock | a38d3c516f5f965822610edcf113f59412905c03 | [
"MIT"
] | null | null | null | Question_21_30/codes/question27.py | uehir0/Gasyori100knock | a38d3c516f5f965822610edcf113f59412905c03 | [
"MIT"
] | null | null | null | Question_21_30/codes/question27.py | uehir0/Gasyori100knock | a38d3c516f5f965822610edcf113f59412905c03 | [
"MIT"
] | null | null | null | import cv2
import numpy as np
img = cv2.imread("imori.jpg").astype(np.float)
H,W,C=img.shape
# Nearest Neighbor
a = 1.5
aH = int(a * H)
aW = int(a * W)
y = np.arange(aH).repeat(aW).reshape(aW,aH)
y = (y / a)
x = np.tile(np.arange(aW),(aH,1))
x = (x / a)
fy = np.floor(y).astype(np.int)
fx = np.floor(x).astype(np.int)... | 24.074627 | 74 | 0.537508 | import cv2
import numpy as np
import matplotlib.pyplot as plt
img = cv2.imread("imori.jpg").astype(np.float)
H,W,C=img.shape
# Nearest Neighbor
a = 1.5
aH = int(a * H)
aW = int(a * W)
y = np.arange(aH).repeat(aW).reshape(aW,aH)
y = (y / a)
x = np.tile(np.arange(aW),(aH,1))
x = (x / a)
fy = np.floor(y).astype(np.int)... | 24 | 0 | 0 | 0 | 0 | 281 | 0 | 10 | 45 |
d1e046d004824bfeb6e17bd750c82884ad9fb701 | 1,227 | py | Python | afriproperty/utils/context_processors.py | dark-codr/propertyconnect | 2ec6d427f55ecea37fd3db86dd8c8f2ccd6e5ee6 | [
"MIT"
] | null | null | null | afriproperty/utils/context_processors.py | dark-codr/propertyconnect | 2ec6d427f55ecea37fd3db86dd8c8f2ccd6e5ee6 | [
"MIT"
] | null | null | null | afriproperty/utils/context_processors.py | dark-codr/propertyconnect | 2ec6d427f55ecea37fd3db86dd8c8f2ccd6e5ee6 | [
"MIT"
] | null | null | null | from django.conf import settings
from afriproperty.property.models import City, Property, PropertyCompare
from afriproperty.tips.models import Tip
def settings_context(_request):
"""Settings available by default to the templates context."""
# Note: we intentionally do NOT expose the entire settings
# to ... | 51.125 | 125 | 0.719641 | from django.conf import settings
from afriproperty.property.models import City, Property, PropertyCompare
from afriproperty.tips.models import Tip
def settings_context(_request):
"""Settings available by default to the templates context."""
# Note: we intentionally do NOT expose the entire settings
# to ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
64c3a1b256280acd0c945fc416d86a7cbde97fd2 | 2,233 | py | Python | qiskit/chemistry/transformations/__init__.py | stefan-woerner/aqua | 12e1b867e254977d9c5992612a7919d8fe016cb4 | [
"Apache-2.0"
] | 504 | 2018-12-15T16:34:03.000Z | 2022-03-26T11:24:53.000Z | qiskit/chemistry/transformations/__init__.py | stefan-woerner/aqua | 12e1b867e254977d9c5992612a7919d8fe016cb4 | [
"Apache-2.0"
] | 746 | 2018-12-16T16:44:42.000Z | 2021-07-10T16:59:43.000Z | qiskit/chemistry/transformations/__init__.py | stefan-woerner/aqua | 12e1b867e254977d9c5992612a7919d8fe016cb4 | [
"Apache-2.0"
] | 421 | 2018-12-22T14:49:00.000Z | 2022-03-04T09:47:07.000Z | # This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... | 30.175676 | 96 | 0.685177 | # This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 152 | 0 |
5b945e679592f7fceb8f2be8c53d5f108fc7aee1 | 726 | py | Python | scripts/common.py | marcusbfs/msanalyzer | 5a633716807a8ffe44c7651cf70de8fea10a1532 | [
"MIT"
] | null | null | null | scripts/common.py | marcusbfs/msanalyzer | 5a633716807a8ffe44c7651cf70de8fea10a1532 | [
"MIT"
] | 1 | 2020-06-29T19:43:58.000Z | 2020-06-29T19:43:58.000Z | scripts/common.py | marcusbfs/msanalyzer | 5a633716807a8ffe44c7651cf70de8fea10a1532 | [
"MIT"
] | null | null | null | import os
from pathlib import Path
scripts_dir = Path(__file__).parent.absolute()
repo_dir = scripts_dir.parent.absolute()
python_exe = os.path.join(repo_dir, "msanalyzer_venv", "Scripts", "python.exe")
dist_folder = scripts_dir / "dist"
main_py = os.path.join(repo_dir, "local_api.py")
# mpl data
matplotlibrc = script... | 34.571429 | 81 | 0.735537 | import os
from pathlib import Path
scripts_dir = Path(__file__).parent.absolute()
repo_dir = scripts_dir.parent.absolute()
python_exe = os.path.join(repo_dir, "msanalyzer_venv", "Scripts", "python.exe")
dist_folder = scripts_dir / "dist"
main_py = os.path.join(repo_dir, "local_api.py")
# mpl data
matplotlibrc = script... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
bfbf999baf70de3061e67f6078a9d972a67fe7b6 | 2,402 | py | Python | samples/parallel-processing-california-housing-data/ml_model/training/training_aml.py | h2floh/MLOpsManufacturing-1 | 3fcf15ef80600540450d16eae57b853d88a83063 | [
"Apache-2.0"
] | 20 | 2020-11-09T08:20:13.000Z | 2021-12-03T06:15:45.000Z | samples/parallel-processing-california-housing-data/ml_model/training/training_aml.py | h2floh/MLOpsManufacturing-1 | 3fcf15ef80600540450d16eae57b853d88a83063 | [
"Apache-2.0"
] | 55 | 2020-10-20T02:18:56.000Z | 2021-07-26T04:52:23.000Z | samples/parallel-processing-california-housing-data/ml_model/training/training_aml.py | h2floh/MLOpsManufacturing-1 | 3fcf15ef80600540450d16eae57b853d88a83063 | [
"Apache-2.0"
] | 10 | 2020-11-26T05:47:57.000Z | 2022-03-23T20:26:00.000Z | """Training wrapper: script to be executed when running Training Step."""
import json
from logging import INFO, Formatter, StreamHandler, getLogger
from pathlib import Path, PurePath
import joblib
import pandas as pd
from azureml.core import Run
from sklearn.linear_model import LinearRegression
from sklearn.model_sele... | 31.194805 | 142 | 0.697752 | """Training wrapper: script to be executed when running Training Step."""
import json
from logging import INFO, Formatter, StreamHandler, getLogger
from pathlib import Path, PurePath
import click
import joblib
import pandas as pd
from azureml.core import Run
from sklearn.linear_model import LinearRegression
from skle... | 0 | 420 | 0 | 0 | 0 | 0 | 0 | -9 | 46 |
68cccd3cc90109ca345a52907a058260c53869b4 | 632 | py | Python | python_demos/sockets_demo/server.py | t4d-classes/advanced-python_01102022 | bf20d78f0ad44324998ceed8bdd377ec1805f97e | [
"MIT"
] | null | null | null | python_demos/sockets_demo/server.py | t4d-classes/advanced-python_01102022 | bf20d78f0ad44324998ceed8bdd377ec1805f97e | [
"MIT"
] | null | null | null | python_demos/sockets_demo/server.py | t4d-classes/advanced-python_01102022 | bf20d78f0ad44324998ceed8bdd377ec1805f97e | [
"MIT"
] | 1 | 2022-01-14T18:12:37.000Z | 2022-01-14T18:12:37.000Z | """ sockets server """
import socket
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as socket_server:
socket_server.bind( ('127.0.0.1', 5025) )
socket_server.listen()
print("server is listening on 127.0.0.1:5025")
conn, addr = socket_server.accept() # accept is the blocking call
pr... | 28.727273 | 72 | 0.636076 | """ sockets server """
import socket
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as socket_server:
socket_server.bind( ('127.0.0.1', 5025) )
socket_server.listen()
print("server is listening on 127.0.0.1:5025")
conn, addr = socket_server.accept() # accept is the blocking call
pr... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7751ad7868874cbb688e851001166aa82832d728 | 56,164 | py | Python | samples/NGPF/SDN/BGP-Flowspec/BGP6_FS_Sample_Scripts.py | vlad-shulika/ixnetwork-api-py | 2ed71d52dd210a2d08250256c3b198a9c7c67dca | [
"MIT"
] | 3 | 2018-12-04T20:06:13.000Z | 2022-02-04T01:28:45.000Z | samples/NGPF/SDN/BGP-Flowspec/BGP6_FS_Sample_Scripts.py | vlad-shulika/ixnetwork-api-py | 2ed71d52dd210a2d08250256c3b198a9c7c67dca | [
"MIT"
] | 3 | 2018-05-23T17:32:56.000Z | 2020-08-26T13:00:42.000Z | samples/NGPF/SDN/BGP-Flowspec/BGP6_FS_Sample_Scripts.py | vlad-shulika/ixnetwork-api-py | 2ed71d52dd210a2d08250256c3b198a9c7c67dca | [
"MIT"
] | 9 | 2018-12-04T20:09:24.000Z | 2021-05-12T10:28:05.000Z | # -*- coding: utf-8 -*-
################################################################################
# #
# Copyright 1997 - 2019 by IXIA Keysight #
# All Rights Reserved. ... | 58.080662 | 120 | 0.406933 | # -*- coding: utf-8 -*-
################################################################################
# #
# Copyright 1997 - 2019 by IXIA Keysight #
# All Rights Reserved. ... | 0 | 0 | 0 | 0 | 0 | 261 | 0 | 5 | 35 |
896720188f12860fb4c146d44d47d36fcb941d6d | 6,972 | py | Python | neuro-sdk/tests/test_buckets.py | neuro-inc/platform-client-python | 012e355249ea900b76f9ce4209fb9d029652f9b2 | [
"Apache-2.0"
] | 11 | 2020-10-11T15:38:11.000Z | 2021-11-09T11:29:50.000Z | neuro-sdk/tests/test_buckets.py | neuro-inc/platform-client-python | 012e355249ea900b76f9ce4209fb9d029652f9b2 | [
"Apache-2.0"
] | 611 | 2020-09-30T21:27:52.000Z | 2022-01-10T10:44:44.000Z | neuro-sdk/tests/test_buckets.py | neuro-inc/platform-client-python | 012e355249ea900b76f9ce4209fb9d029652f9b2 | [
"Apache-2.0"
] | 1 | 2020-10-05T15:10:24.000Z | 2020-10-05T15:10:24.000Z | from typing import Callable
from neuro_sdk import Client
_MakeClient = Callable[..., Client]
| 28.341463 | 88 | 0.535427 | from datetime import datetime, timedelta
from typing import Callable
from aiohttp import web
from neuro_sdk import Bucket, Client, Cluster
from tests import _TestServerFactory
_MakeClient = Callable[..., Client]
async def test_list(
aiohttp_server: _TestServerFactory,
make_client: _MakeClient,
cluster... | 0 | 0 | 6,612 | 0 | 0 | 0 | 0 | 53 | 206 |
60d70cec2b665030a43396f02afba76673f24945 | 451 | py | Python | stanza/utils/select_backoff.py | danielhers/stanza | d747a7b781da203c286ec51e3842fecb8b0abb15 | [
"Apache-2.0"
] | 3,633 | 2016-01-21T17:29:13.000Z | 2022-03-31T13:36:47.000Z | stanza/utils/select_backoff.py | danielhers/stanza | d747a7b781da203c286ec51e3842fecb8b0abb15 | [
"Apache-2.0"
] | 593 | 2016-01-19T07:16:05.000Z | 2022-03-31T20:23:58.000Z | stanza/utils/select_backoff.py | danielhers/stanza | d747a7b781da203c286ec51e3842fecb8b0abb15 | [
"Apache-2.0"
] | 525 | 2016-01-20T03:22:19.000Z | 2022-03-24T05:51:56.000Z | import sys
backoff_models = { "UD_Breton-KEB": "ga_idt",
"UD_Czech-PUD": "cs_pdt",
"UD_English-PUD": "en_ewt",
"UD_Faroese-OFT": "nn_nynorsk",
"UD_Finnish-PUD": "fi_tdt",
"UD_Japanese-Modern": "ja_gsd",
"U... | 32.214286 | 51 | 0.467849 | import sys
backoff_models = { "UD_Breton-KEB": "ga_idt",
"UD_Czech-PUD": "cs_pdt",
"UD_English-PUD": "en_ewt",
"UD_Faroese-OFT": "nn_nynorsk",
"UD_Finnish-PUD": "fi_tdt",
"UD_Japanese-Modern": "ja_gsd",
"U... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c4e65e1df7c301101446ffc48d8206c89fed3575 | 2,605 | py | Python | scripts/02_bert_ner/main.py | harri-pltr/slovnet | 5cd91358ca32f6c08cf38b8f39b3058643bc26dc | [
"MIT"
] | 147 | 2019-09-02T10:56:38.000Z | 2022-03-31T16:09:01.000Z | scripts/02_bert_ner/main.py | harri-pltr/slovnet | 5cd91358ca32f6c08cf38b8f39b3058643bc26dc | [
"MIT"
] | 9 | 2020-04-28T13:58:12.000Z | 2022-02-19T21:45:55.000Z | scripts/02_bert_ner/main.py | harri-pltr/slovnet | 5cd91358ca32f6c08cf38b8f39b3058643bc26dc | [
"MIT"
] | 14 | 2020-03-01T21:09:34.000Z | 2022-03-12T19:34:36.000Z |
from os import getenv
from os.path import join
from slovnet.const import (CUDA0)
DATA_DIR = 'data'
MODEL_DIR = 'model'
BERT_DIR = 'bert'
RAW_DIR = join(DATA_DIR, 'raw')
CORUS_NE5 = join(RAW_DIR, 'Collection5')
CORUS_FACTRU = join(RAW_DIR, 'factRuEval-2016-master')
NE5 = join(DATA_DIR, 'ne5.jl.gz')
FACTRU = join(DA... | 21.178862 | 54 | 0.722457 |
from os import getenv, environ
from os.path import exists, join, expanduser
from random import seed, sample, randint, uniform
from subprocess import run
from tqdm.notebook import tqdm as log_progress
import torch
from torch import optim
from naeval.ner.datasets import (
load_factru,
load_ne5,
)
from slovne... | 0 | 0 | 0 | 0 | 0 | 290 | 0 | 631 | 380 |
23740683f3458ce2d3f4a021484dd413b45aecac | 3,320 | py | Python | topologic/assertions.py | microsoft/topologic | d3a2155a42469ccb16de178f47bec81b0476fdc8 | [
"MIT"
] | 24 | 2020-02-10T23:51:06.000Z | 2021-11-17T02:34:47.000Z | topologic/assertions.py | microsoft/topologic | d3a2155a42469ccb16de178f47bec81b0476fdc8 | [
"MIT"
] | 26 | 2020-02-11T18:37:33.000Z | 2020-11-11T00:14:41.000Z | topologic/assertions.py | microsoft/topologic | d3a2155a42469ccb16de178f47bec81b0476fdc8 | [
"MIT"
] | 6 | 2020-07-31T11:05:36.000Z | 2021-11-10T08:18:52.000Z | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import networkx as nx
from .exceptions import UnweightedGraphError, InvalidGraphError
def assert_is_graph(graph: nx.Graph):
"""
Asserts that an object is a networkx graph
:param graph: Graph to check
:raises TypeError: If graph... | 32.54902 | 119 | 0.688554 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import networkx as nx
from .exceptions import UnweightedGraphError, InvalidGraphError
def assert_is_graph(graph: nx.Graph):
"""
Asserts that an object is a networkx graph
:param graph: Graph to check
:raises TypeError: If graph... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9621d12e8a4473ce15a62326ae65c3a784143860 | 8,937 | py | Python | python/ooi_data_explorations/uncabled/process_metbk.py | bkuebel/ooi-data-explorations | 906221d9d9a01ee96b1747d3abab2b0b46ae534d | [
"MIT"
] | null | null | null | python/ooi_data_explorations/uncabled/process_metbk.py | bkuebel/ooi-data-explorations | 906221d9d9a01ee96b1747d3abab2b0b46ae534d | [
"MIT"
] | null | null | null | python/ooi_data_explorations/uncabled/process_metbk.py | bkuebel/ooi-data-explorations | 906221d9d9a01ee96b1747d3abab2b0b46ae534d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
from gsw.conversions import SP_from_C
def metbk_hourly(ds):
"""
Takes METBK hourly averaged bulk flux estimates from the CGSN/EA moorings
and cleans up the data set to make it more user-friendly. Primary task is
renaming parameters and d... | 43.595122 | 119 | 0.657827 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import os
from ooi_data_explorations.common import inputs, m2m_collect, m2m_request, get_deployment_dates, \
get_vocabulary, dt64_epoch, update_dataset, ENCODINGS
from gsw.conversions import SP_from_C
def metbk_hourly(ds):
"""
Takes METBK h... | 0 | 0 | 0 | 0 | 0 | 2,614 | 0 | 123 | 68 |
5ed3760c73aad0d60a0d193d442935018566c4c5 | 986 | py | Python | Curso de Cisco/Actividades/Act 4 - Modulo 5.py | tomasfriz/Curso-de-Cisco | a50ee5fa96bd86d468403e29ccdc3565a181af60 | [
"MIT"
] | null | null | null | Curso de Cisco/Actividades/Act 4 - Modulo 5.py | tomasfriz/Curso-de-Cisco | a50ee5fa96bd86d468403e29ccdc3565a181af60 | [
"MIT"
] | null | null | null | Curso de Cisco/Actividades/Act 4 - Modulo 5.py | tomasfriz/Curso-de-Cisco | a50ee5fa96bd86d468403e29ccdc3565a181af60 | [
"MIT"
] | null | null | null | # Ingresa el texto a encriptar
texto= input("Ingresa un mensaje: ")
# Ingresa un valor de cambio vlido (repitelo hasta que tengas xito)
shift = 0
while shift == 0:
try:
shift = int(input("Ingresa el valor de cambio del cifrado (1..25): "))
if shift not in range(1,26):
raise ValueError... | 25.947368 | 78 | 0.573022 | # Ingresa el texto a encriptar
texto= input("Ingresa un mensaje: ")
# Ingresa un valor de cambio válido (repitelo hasta que tengas éxito)
shift = 0
while shift == 0:
try:
shift = int(input("Ingresa el valor de cambio del cifrado (1..25): "))
if shift not in range(1,26):
raise ValueEr... | 21 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
bddd1dfc42fb14a1b260e398046b860098146bdc | 465 | py | Python | sdk/boost_1_30_0/libs/python/test/exception_translator.py | acidicMercury8/xray-1.0 | 65e85c0e31e82d612c793d980dc4b73fa186c76c | [
"Linux-OpenIB"
] | 2 | 2020-01-30T12:51:49.000Z | 2020-08-31T08:36:49.000Z | sdk/boost_1_30_0/libs/python/test/exception_translator.py | acidicMercury8/xray-1.0 | 65e85c0e31e82d612c793d980dc4b73fa186c76c | [
"Linux-OpenIB"
] | null | null | null | sdk/boost_1_30_0/libs/python/test/exception_translator.py | acidicMercury8/xray-1.0 | 65e85c0e31e82d612c793d980dc4b73fa186c76c | [
"Linux-OpenIB"
] | null | null | null | '''
>>> from exception_translator_ext import *
>>> try:
... throw_error();
... except RuntimeError, x:
... print x
... else:
... print 'Expected a RuntimeError!'
!!!error!!!
'''
if __name__ == '__main__':
print "running..."
import sys
sys.exit(run()[0])
| 20.217391 | 54 | 0.56129 | '''
>>> from exception_translator_ext import *
>>> try:
... throw_error();
... except RuntimeError, x:
... print x
... else:
... print 'Expected a RuntimeError!'
!!!error!!!
'''
def run(args = None):
import sys
import doctest
if args is not None:
sys.argv = args
retu... | 0 | 0 | 0 | 0 | 0 | 144 | 0 | 0 | 23 |
1b0ba3d50363aa9f463569b4c8e20c084a432f0a | 3,069 | py | Python | trivium/api/rest_organization.py | TripleDotEng/trivium-cli | 4291ed1d71d728ac3c0c738f7367f21521e393f4 | [
"MIT"
] | null | null | null | trivium/api/rest_organization.py | TripleDotEng/trivium-cli | 4291ed1d71d728ac3c0c738f7367f21521e393f4 | [
"MIT"
] | null | null | null | trivium/api/rest_organization.py | TripleDotEng/trivium-cli | 4291ed1d71d728ac3c0c738f7367f21521e393f4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
api/rest_organization.py
Copyright 2021 Triple Dot Engineering LLC
Defines the RestOrg class used to interact with organizations via the API.
"""
from .. import util
| 24.95122 | 79 | 0.548061 | #!/usr/bin/env python
"""
api/rest_organization.py
Copyright 2021 Triple Dot Engineering LLC
Defines the RestOrg class used to interact with organizations via the API.
"""
import json
from .. import util
from ._abc_rest_obj import RestObject
from .api import TriviumApi
class RestOrg(RestObject):
"""Class for in... | 0 | 1,803 | 0 | 970 | 0 | 0 | 0 | 12 | 89 |
49e82d7eedc2e715c06f458b32cf77e502903b12 | 4,857 | py | Python | everglade/lexer.py | DefaltSimon/everglade | 401060e59c5fe95338bf2843d932462515fcb89c | [
"MIT"
] | null | null | null | everglade/lexer.py | DefaltSimon/everglade | 401060e59c5fe95338bf2843d932462515fcb89c | [
"MIT"
] | null | null | null | everglade/lexer.py | DefaltSimon/everglade | 401060e59c5fe95338bf2843d932462515fcb89c | [
"MIT"
] | null | null | null | # coding=utf-8
ALLOWED_CHARS = "abcdefghijklmnopqrstuvwxyz_"
| 28.739645 | 70 | 0.463043 | # coding=utf-8
from everglade.tokens import TokenType, Token
ALLOWED_CHARS = "abcdefghijklmnopqrstuvwxyz_"
def is_special(char: str) -> bool:
return char in ALLOWED_CHARS
class Lexer:
def __init__(self, raw_text):
self.text = raw_text
self.pos = 0
self.char = self.text[self.pos]
... | 0 | 0 | 0 | 4,655 | 0 | 46 | 0 | 24 | 68 |
d81e1db454bd112ebe4b9eb0e928f7c781014326 | 32,155 | py | Python | datasets/thelook_ecommerce/pipelines/_images/run_thelook_kub/fake.py | arjunsgill/public-datasets-pipelines | 45dd0b2c15821e38f0b7b511c253025fc7497ad0 | [
"Apache-2.0"
] | null | null | null | datasets/thelook_ecommerce/pipelines/_images/run_thelook_kub/fake.py | arjunsgill/public-datasets-pipelines | 45dd0b2c15821e38f0b7b511c253025fc7497ad0 | [
"Apache-2.0"
] | null | null | null | datasets/thelook_ecommerce/pipelines/_images/run_thelook_kub/fake.py | arjunsgill/public-datasets-pipelines | 45dd0b2c15821e38f0b7b511c253025fc7497ad0 | [
"Apache-2.0"
] | null | null | null | import json
import logging
import os
import faker
fake = faker.Faker()
# final datasets
orders = list()
users = list()
order_items = list()
events = list()
inventory_items = list()
# read from local csv and return products
# read from local csv and return locations
SECONDS_IN_MINUTE = 60
MINUTES_IN_HOUR = 60
MI... | 39.070474 | 261 | 0.621832 | import collections
import csv
import dataclasses
import datetime
import io
import itertools
import json
import logging
import os
import random
import typing
import uuid
import faker
import numpy as np
from google.cloud import storage
fake = faker.Faker()
# final datasets
orders = list()
users = list()
order_items = l... | 0 | 18,989 | 0 | 1,027 | 0 | 10,332 | 0 | -58 | 625 |
18babf467d84bab7ec1d299308b0f96c72b2c39c | 16,833 | py | Python | export_pmx.py | ousttrue/blpymeshio | 6f79c0b1c902f297ebb562cee633fbbab8790cd6 | [
"MIT"
] | 4 | 2019-10-02T20:46:18.000Z | 2021-03-16T23:35:48.000Z | export_pmx.py | ousttrue/blpymeshio | 6f79c0b1c902f297ebb562cee633fbbab8790cd6 | [
"MIT"
] | 3 | 2018-08-27T16:15:33.000Z | 2020-05-19T17:29:50.000Z | export_pmx.py | ousttrue/blpymeshio | 6f79c0b1c902f297ebb562cee633fbbab8790cd6 | [
"MIT"
] | 5 | 2019-05-13T18:23:39.000Z | 2021-07-05T20:56:10.000Z | # coding: utf-8
from . import bl
from . import exporter
from pymeshio import pmx
from pymeshio import common
def create_pmx(ex, enable_bdef4=True):
"""
PMX
"""
model=pmx.Model()
o=ex.root.o
model.name=o.get(bl.MMD_MB_NAME, 'Blender')
model.english_name=o.get(bl.MMD_ENGLISH_NAME, 'blende... | 35.141962 | 92 | 0.558308 | # coding: utf-8
import io
from . import bl
from . import exporter
from pymeshio import pmx
from pymeshio import common
from pymeshio.pmx import writer
import bpy
import bpy_extras.io_utils # pylint: disable=E0401
def near(x, y, EPSILON=1e-5):
d=x-y
return d>=-EPSILON and d<=EPSILON
def create_pmx(ex, enabl... | 132 | 265 | 0 | 2,247 | 0 | 4,236 | 0 | -8 | 374 |
43dd17c2074898d20de66fd0bfb62f3790e78406 | 4,400 | py | Python | explorerscript/ssb_converting/compiler/compile_handlers/blocks/ifs/if_header.py | dotlambda/ExplorerScript | 5fbb5de3d58821eb79f1972e8df9af26fefadaa4 | [
"MIT"
] | 11 | 2020-06-05T06:29:06.000Z | 2022-03-11T09:50:09.000Z | explorerscript/ssb_converting/compiler/compile_handlers/blocks/ifs/if_header.py | dotlambda/ExplorerScript | 5fbb5de3d58821eb79f1972e8df9af26fefadaa4 | [
"MIT"
] | 16 | 2020-06-19T11:59:08.000Z | 2022-01-10T09:08:53.000Z | explorerscript/ssb_converting/compiler/compile_handlers/blocks/ifs/if_header.py | dotlambda/ExplorerScript | 5fbb5de3d58821eb79f1972e8df9af26fefadaa4 | [
"MIT"
] | 2 | 2021-11-14T16:33:30.000Z | 2021-12-18T22:05:31.000Z | # MIT License
#
# Copyright (c) 2020-2021 Parakoopa and the SkyTemple Contributors
#
# 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... | 50.574713 | 115 | 0.724318 | # MIT License
#
# Copyright (c) 2020-2021 Parakoopa and the SkyTemple Contributors
#
# 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... | 0 | 0 | 0 | 2,131 | 0 | 0 | 0 | 821 | 288 |
cd628422609e27fdd51e2466d4b2bf2b47fb7c29 | 1,216 | py | Python | old/UG/tests/blackbox/syndicate-httpd/PUT.py | jcnelson/syndicate | 4837265be3e0aa18cdf4ee50316dbfc2d1f06e5b | [
"Apache-2.0"
] | 16 | 2015-01-02T15:39:04.000Z | 2016-03-17T06:38:46.000Z | old/UG/tests/blackbox/syndicate-httpd/PUT.py | jcnelson/syndicate | 4837265be3e0aa18cdf4ee50316dbfc2d1f06e5b | [
"Apache-2.0"
] | 37 | 2015-01-28T20:58:05.000Z | 2016-03-22T04:01:32.000Z | old/UG/tests/blackbox/syndicate-httpd/PUT.py | jcnelson/syndicate | 4837265be3e0aa18cdf4ee50316dbfc2d1f06e5b | [
"Apache-2.0"
] | 8 | 2015-04-08T02:26:03.000Z | 2016-03-04T05:56:24.000Z | #!/usr/bin/python
import socket
import time
import sys
import urllib2
import os
import base64
auth = "jude:sniff"
hostname = sys.argv[1]
port = int(sys.argv[2] )
filename = sys.argv[3]
data_fd = None
data_path = None
if len(sys.argv) > 4:
data_path = sys.argv[4]
data_fd = open( data_path, "r" )
mode = '0644'
... | 19.612903 | 69 | 0.602796 | #!/usr/bin/python
import socket
import time
import sys
import urllib2
import os
import base64
auth = "jude:sniff"
hostname = sys.argv[1]
port = int(sys.argv[2] )
filename = sys.argv[3]
data_fd = None
data_path = None
if len(sys.argv) > 4:
data_path = sys.argv[4]
data_fd = open( data_path, "r" )
mode = '0644'
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
222dad8d3e3e093ca70837072f98d16ce20b3b5b | 2,212 | py | Python | pre_commit_sync/pre_commit_sync.py | dvolgyes/pre-commit-sync | b61c881baa204a72987a20b20e4fa03e660c1035 | [
"BSD-3-Clause"
] | 1 | 2020-09-29T22:03:11.000Z | 2020-09-29T22:03:11.000Z | pre_commit_sync/pre_commit_sync.py | dvolgyes/pre-commit-sync | b61c881baa204a72987a20b20e4fa03e660c1035 | [
"BSD-3-Clause"
] | null | null | null | pre_commit_sync/pre_commit_sync.py | dvolgyes/pre-commit-sync | b61c881baa204a72987a20b20e4fa03e660c1035 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
if __name__ == '__main__':
main()
| 29.105263 | 105 | 0.613472 | #!/usr/bin/python
import sys
import argparse
from pathlib import Path
import urllib.request
import git
def process(fname, url):
f = Path(fname.strip())
with urllib.request.urlopen(url) as web:
content = web.read()
if f.exists():
file_content = f.read_bytes()
else:
file_conten... | 0 | 0 | 0 | 0 | 0 | 2,022 | 0 | -25 | 156 |
59976c7e201cb504051a3226d3f0899be2813ff7 | 433 | py | Python | test/testAll.py | slalom/sf-iot-hackathon | 89a1f147e1be7fb7609d02cbf469cd83b8dd6c9d | [
"MIT"
] | 1 | 2021-03-24T17:53:33.000Z | 2021-03-24T17:53:33.000Z | test/testAll.py | slalom/sf-iot-hackathon | 89a1f147e1be7fb7609d02cbf469cd83b8dd6c9d | [
"MIT"
] | 8 | 2020-03-24T17:44:09.000Z | 2022-03-12T01:03:22.000Z | test/testAll.py | slalom/sf-iot-hackathon | 89a1f147e1be7fb7609d02cbf469cd83b8dd6c9d | [
"MIT"
] | 2 | 2021-03-24T17:53:37.000Z | 2022-03-07T10:34:00.000Z | import predict
import os
import pandas as pd
directory = os.path.join(os.path.dirname(__file__), '..', 'chainsaw')
predictions = []
for file_name in os.listdir(directory):
(predicted_class, predicted_proba, le) = predict.predict(os.path.join(directory, file_name))
predictions.append(predicted_class)
df = pd.Dat... | 27.0625 | 94 | 0.766744 | import numpy as np
import predict
import os
import pandas as pd
directory = os.path.join(os.path.dirname(__file__), '..', 'chainsaw')
predictions = []
for file_name in os.listdir(directory):
(predicted_class, predicted_proba, le) = predict.predict(os.path.join(directory, file_name))
predictions.append(predicted_... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -3 | 22 |
0631ebbbd9b2c4f8e2bea106ebd40a8d17921b3a | 8,524 | py | Python | spine/spine_adapter/kafka_client/kafka_async_consumer.py | ElasticRun/spine | 0be82de83d4117adeda62b75b8ea92b46c48b4f5 | [
"MIT"
] | null | null | null | spine/spine_adapter/kafka_client/kafka_async_consumer.py | ElasticRun/spine | 0be82de83d4117adeda62b75b8ea92b46c48b4f5 | [
"MIT"
] | null | null | null | spine/spine_adapter/kafka_client/kafka_async_consumer.py | ElasticRun/spine | 0be82de83d4117adeda62b75b8ea92b46c48b4f5 | [
"MIT"
] | null | null | null |
logger = None
| 52.617284 | 129 | 0.523346 | import json, datetime
from confluent_kafka import Consumer, TopicPartition
from confluent_kafka.cimpl import KafkaError, KafkaException
import frappe
from frappe.utils.logger import get_logger
from spine.spine_adapter.scheduler.message_processor import process_message, skip_message
logger = None
class KafkaAsyncSi... | 0 | 0 | 0 | 8,200 | 0 | 0 | 0 | 151 | 157 |
2062134262a738e7907debdbb289e19dca32fc00 | 779 | py | Python | indexdigest/test/linters/test_0094_generic_primary_key.py | macbre/index-digest | cb0c42f3905b608d58e1c214f461352b74aaa8df | [
"MIT"
] | 41 | 2017-10-25T11:52:50.000Z | 2022-02-10T07:18:06.000Z | indexdigest/test/linters/test_0094_generic_primary_key.py | macbre/index-digest | cb0c42f3905b608d58e1c214f461352b74aaa8df | [
"MIT"
] | 120 | 2017-09-28T17:07:52.000Z | 2022-03-31T03:20:55.000Z | indexdigest/test/linters/test_0094_generic_primary_key.py | macbre/index-digest | cb0c42f3905b608d58e1c214f461352b74aaa8df | [
"MIT"
] | 6 | 2017-11-09T19:52:44.000Z | 2022-03-15T09:44:18.000Z | from __future__ import print_function
| 35.409091 | 118 | 0.727856 | from __future__ import print_function
from unittest import TestCase
from indexdigest.linters.linter_0094_generic_primary_key import check_generic_primary_key
from indexdigest.test import DatabaseTestMixin
class TestLinter(TestCase, DatabaseTestMixin):
def test_generic_primary_key(self):
reports = list(... | 0 | 0 | 0 | 548 | 0 | 0 | 0 | 101 | 91 |
31ebda15ab201165720f5c2f2a7c623fb89ba4c5 | 3,242 | py | Python | huaweisms/api/common.py | growield/huawei-modem-py-api-client-through-proxy | 8cae130f43871938392292e527b79bb15f314fd3 | [
"MIT"
] | 1 | 2021-03-05T12:53:16.000Z | 2021-03-05T12:53:16.000Z | huaweisms/api/common.py | m-krasikov/huawei-modem-py-api-client-through-proxy | 8cae130f43871938392292e527b79bb15f314fd3 | [
"MIT"
] | null | null | null | huaweisms/api/common.py | m-krasikov/huawei-modem-py-api-client-through-proxy | 8cae130f43871938392292e527b79bb15f314fd3 | [
"MIT"
] | null | null | null | import logging
logger = logging.getLogger(__name__)
| 25.730159 | 110 | 0.637261 | import logging
from typing import Union
from xml.dom.minidom import Element
import requests
from huaweisms.api.config import MODEM_HOST
from huaweisms.xml.util import get_child_text, parse_xml_string, get_dictionary_from_children
logger = logging.getLogger(__name__)
class ApiCtx:
def __init__(self, modem_hos... | 0 | 244 | 0 | 550 | 0 | 1,985 | 0 | 105 | 296 |
af3c2f939f99c69f4eea7bf33ae27fcb67447244 | 1,022 | py | Python | tutorial/01.py | mssung94/daishin-trading-system | d6682495afb7a08e68db65537b1d1789f2996891 | [
"MIT"
] | 2 | 2020-11-21T08:45:26.000Z | 2020-11-21T08:50:56.000Z | tutorial/01.py | mssung94/daishin-trading-system | d6682495afb7a08e68db65537b1d1789f2996891 | [
"MIT"
] | null | null | null | tutorial/01.py | mssung94/daishin-trading-system | d6682495afb7a08e68db65537b1d1789f2996891 | [
"MIT"
] | null | null | null | # API
#
import win32com.client
#
objCpCybos = win32com.client.Dispatch("CpUtil.CpCybos")
bConnect = objCpCybos.IsConnect
if (bConnect == 0):
print("PLUS . ")
exit()
#
objCpCodeMgr = win32com.client.Dispatch("CpUtil.CpCodeMgr")
codeList = objCpCodeMgr.GetStockListByMarket(1) #
cod... | 31.9375 | 60 | 0.716243 | # 대신증권 API
# 종목정보 구하는 예제
import win32com.client
# 연결 여부 체크
objCpCybos = win32com.client.Dispatch("CpUtil.CpCybos")
bConnect = objCpCybos.IsConnect
if (bConnect == 0):
print("PLUS가 정상적으로 연결되지 않음. ")
exit()
# 종목코드 리스트 구하기
objCpCodeMgr = win32com.client.Dispatch("CpUtil.CpCodeMgr")
codeList = objC... | 213 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
167f4d06a5733ff1010c2d3084136ed13d193765 | 391 | py | Python | chipy_org/apps/announcements/admin.py | SarthakAdhikari/chipy.org | e6ef9bce7b84cdcd3e98caf18f177c197666b819 | [
"MIT"
] | 88 | 2015-01-01T21:12:18.000Z | 2022-03-01T13:36:59.000Z | chipy_org/apps/announcements/admin.py | SarthakAdhikari/chipy.org | e6ef9bce7b84cdcd3e98caf18f177c197666b819 | [
"MIT"
] | 296 | 2015-01-02T15:55:19.000Z | 2022-03-20T20:11:47.000Z | chipy_org/apps/announcements/admin.py | SarthakAdhikari/chipy.org | e6ef9bce7b84cdcd3e98caf18f177c197666b819 | [
"MIT"
] | 83 | 2015-01-25T02:34:24.000Z | 2021-11-08T20:28:36.000Z | from django.contrib import admin
from .models import Announcement
admin.site.register(Announcement, AnnouncementAdmin)
| 21.722222 | 70 | 0.654731 | from django.contrib import admin
from .models import Announcement
class AnnouncementAdmin(admin.ModelAdmin):
list_display = ["id", "active", "end_date", "headline", "created"]
search_fields = [
"id",
"headline",
"body",
]
readonly_fields = ["created", "modified"]
list_filt... | 0 | 0 | 0 | 245 | 0 | 0 | 0 | 0 | 23 |
54efb5157a4e9a7c7c1f54fe09c587e62bc2bf7d | 2,493 | py | Python | app/utils/smmsPic.py | winlongit/shop_pc_server | 376fa5c0504e50a863aad68ead67e0a149ef5dd2 | [
"Apache-2.0"
] | 1 | 2021-12-08T13:59:32.000Z | 2021-12-08T13:59:32.000Z | app/utils/smmsPic.py | winlongit/shop_pc_server | 376fa5c0504e50a863aad68ead67e0a149ef5dd2 | [
"Apache-2.0"
] | null | null | null | app/utils/smmsPic.py | winlongit/shop_pc_server | 376fa5c0504e50a863aad68ead67e0a149ef5dd2 | [
"Apache-2.0"
] | 1 | 2021-12-08T13:59:34.000Z | 2021-12-08T13:59:34.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
-------------------------------------------------
@ Author : pengj
@ date : 2019/12/8 16:30
@ IDE : PyCharm
@ GitHub : https://github.com/JackyPJB
@ Contact : pengjianbiao@hotmail.com
----------------... | 34.625 | 83 | 0.525872 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
-------------------------------------------------
@ Author : pengj
@ date : 2019/12/8 16:30
@ IDE : PyCharm
@ GitHub : https://github.com/JackyPJB
@ Contact : pengjianbiao@hotmail.com
----------------... | 144 | 1,413 | 0 | 323 | 0 | 0 | 0 | -16 | 91 |
21228afac55a9c791bc277b714adaa2ceb8f75be | 6,862 | py | Python | examples/ggh/hashtree.py | Charterhouse/pysnark | 4d8ae194a918c57a84c9f42f2d9809d66e90f006 | [
"RSA-MD"
] | 65 | 2018-01-12T08:49:18.000Z | 2022-03-16T07:35:40.000Z | examples/ggh/hashtree.py | Charterhouse/pysnark | 4d8ae194a918c57a84c9f42f2d9809d66e90f006 | [
"RSA-MD"
] | 9 | 2018-01-19T21:14:02.000Z | 2019-10-15T09:48:01.000Z | examples/ggh/hashtree.py | Charterhouse/pysnark | 4d8ae194a918c57a84c9f42f2d9809d66e90f006 | [
"RSA-MD"
] | 13 | 2018-01-15T20:50:57.000Z | 2022-03-25T05:39:36.000Z | # Copyright (c) 2016-2018 Koninklijke Philips N.V. All rights reserved. A
# copyright license for redistribution and use in source and binary forms,
# with or without modification, is hereby granted for non-commercial,
# experimental and research purposes, provided that the following conditions
# are met:
# - Redistrib... | 36.695187 | 134 | 0.608277 | # Copyright (c) 2016-2018 Koninklijke Philips N.V. All rights reserved. A
# copyright license for redistribution and use in source and binary forms,
# with or without modification, is hereby granted for non-commercial,
# experimental and research purposes, provided that the following conditions
# are met:
# - Redistrib... | 0 | 0 | 0 | 0 | 1,072 | 250 | 0 | 0 | 161 |
6cc2ceecfbcb8b0abfe6e3345d5ae84e315b091d | 781 | py | Python | lib/bes/fs/find/file_type_criteria.py | reconstruir/bes | 82ff54b2dadcaef6849d7de424787f1dedace85c | [
"Apache-2.0"
] | null | null | null | lib/bes/fs/find/file_type_criteria.py | reconstruir/bes | 82ff54b2dadcaef6849d7de424787f1dedace85c | [
"Apache-2.0"
] | null | null | null | lib/bes/fs/find/file_type_criteria.py | reconstruir/bes | 82ff54b2dadcaef6849d7de424787f1dedace85c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#-*- coding:utf-8; mode:python; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*-
| 32.541667 | 94 | 0.710627 | #!/usr/bin/env python
#-*- coding:utf-8; mode:python; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*-
import errno
from .criteria import criteria
from bes.fs import file_type
class file_type_criteria(criteria):
'match the file type.'
def __init__(self, file_type_mask):
super(file_type_criteria, se... | 0 | 0 | 0 | 571 | 0 | 0 | 0 | 7 | 90 |
edd23128c06a2cb8df7a1ce6bbcfcd35d25f04e0 | 87 | py | Python | lta/helpers/__init__.py | IMS-Bio2Core-Facility/lta | 79078a0daa05ee81c97612056ee2151c9b8a6ce7 | [
"MIT"
] | 1 | 2021-12-22T20:29:22.000Z | 2021-12-22T20:29:22.000Z | lta/helpers/__init__.py | IMS-Bio2Core-Facility/lta | 79078a0daa05ee81c97612056ee2151c9b8a6ce7 | [
"MIT"
] | 19 | 2021-12-23T15:50:25.000Z | 2022-02-15T16:57:49.000Z | lta/helpers/__init__.py | IMS-Bio2Core-Facility/lta | 79078a0daa05ee81c97612056ee2151c9b8a6ce7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Helper functions and classes for the LTA CLI and parser."""
| 29 | 62 | 0.643678 | # -*- coding: utf-8 -*-
"""Helper functions and classes for the LTA CLI and parser."""
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
19552a449e41734a2151ac275f79c06c4e6e0248 | 1,363 | py | Python | docs/_static/demos/filters/FilterBySequenceRegexDemo.ipynb.py | sbliven/mmtf-pyspark | 3d444178bdc0d5128aafdb1326fec12b5d7634b5 | [
"Apache-2.0"
] | 59 | 2018-01-28T06:50:56.000Z | 2022-02-10T06:07:12.000Z | docs/_static/demos/filters/FilterBySequenceRegexDemo.ipynb.py | sbliven/mmtf-pyspark | 3d444178bdc0d5128aafdb1326fec12b5d7634b5 | [
"Apache-2.0"
] | 101 | 2018-02-01T20:51:10.000Z | 2022-01-24T00:50:29.000Z | docs/_static/demos/filters/FilterBySequenceRegexDemo.ipynb.py | sbliven/mmtf-pyspark | 3d444178bdc0d5128aafdb1326fec12b5d7634b5 | [
"Apache-2.0"
] | 29 | 2018-01-29T10:09:51.000Z | 2022-01-23T18:53:28.000Z |
# coding: utf-8
# # Filter By Sequence Regex Demo
#
# This example shows how to filter poteins by their sequence regualar expression.
#
# [More about regular expression](https://www.regular-expressions.info)
#
# ## Imports
# In[1]:
from pyspark import SparkConf, SparkContext
from mmtfPyspark.io import mmtfRead... | 17.474359 | 99 | 0.694057 |
# coding: utf-8
# # Filter By Sequence Regex Demo
#
# This example shows how to filter poteins by their sequence regualar expression.
#
# [More about regular expression](https://www.regular-expressions.info)
#
# ## Imports
# In[1]:
from pyspark import SparkConf, SparkContext
from mmtfPyspark.io import mmtfRead... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d6beaee48ce4eb34bd0cec140cc6cf639bbc3cba | 812 | py | Python | solutions/insert-interval.py | edab/-LC_StudyPlan_Python | e065f0ced68d23800d7b5001102c2e930ee35e23 | [
"MIT"
] | null | null | null | solutions/insert-interval.py | edab/-LC_StudyPlan_Python | e065f0ced68d23800d7b5001102c2e930ee35e23 | [
"MIT"
] | 1 | 2022-02-22T15:42:54.000Z | 2022-02-25T00:10:04.000Z | solutions/insert-interval.py | edab/-LC_StudyPlan_Python | e065f0ced68d23800d7b5001102c2e930ee35e23 | [
"MIT"
] | null | null | null | # Leetcode 57. Insert Interval
#
# Link: https://leetcode.com/problems/insert-interval/
# Difficulty: Medium
# Solution using DP.
# Complexity:
# O(N) time | where N represent the number of intervals
# O(1) space
| 24.606061 | 106 | 0.591133 | # Leetcode 57. Insert Interval
#
# Link: https://leetcode.com/problems/insert-interval/
# Difficulty: Medium
# Solution using DP.
# Complexity:
# O(N) time | where N represent the number of intervals
# O(1) space
class Solution:
def insert(self, intervals: List[List[int]], newInterval: List[int]) -> List[List[... | 0 | 0 | 0 | 572 | 0 | 0 | 0 | 0 | 22 |