hexsha stringlengths 40 40 | size int64 2 1.05M | ext stringclasses 9
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 193 | max_stars_repo_name stringlengths 6 109 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 36.6k ⌀ | 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 193 | max_issues_repo_name stringlengths 6 109 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 29.8k ⌀ | 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 193 | max_forks_repo_name stringlengths 6 109 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 11.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.05M | avg_line_length float64 1 404k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
74026c268c85f4a4ba9b560d0b49193c44db809d | 7,292 | py | Python | utils.py | unonao/SPENet | 93d316cfd57227c4078d8c0f952a875ed2a33fa2 | [
"Apache-2.0"
] | null | null | null | utils.py | unonao/SPENet | 93d316cfd57227c4078d8c0f952a875ed2a33fa2 | [
"Apache-2.0"
] | null | null | null | utils.py | unonao/SPENet | 93d316cfd57227c4078d8c0f952a875ed2a33fa2 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import numpy.linalg as LA
import os
import networkx as nx
import pandas as pd
# graph path
rodger_graphs = ["data/graph-eigs-v1/as-caida20060911.smat",
"data/graph-eigs-v1/as19991115.smat",
"data/graph-eigs-v1/Erdos02-cc.smat",
"data/graph-eigs-v1/h... | 40.287293 | 120 | 0.605595 |
7402705706b38e471434ff0ce34d2accc9e01229 | 879 | py | Python | catalyst/dl/registry.py | balakhonoff/catalyst | 82d904aee97045efbaef3963e36c2ce5173ddac4 | [
"Apache-2.0"
] | null | null | null | catalyst/dl/registry.py | balakhonoff/catalyst | 82d904aee97045efbaef3963e36c2ce5173ddac4 | [
"Apache-2.0"
] | null | null | null | catalyst/dl/registry.py | balakhonoff/catalyst | 82d904aee97045efbaef3963e36c2ce5173ddac4 | [
"Apache-2.0"
] | 1 | 2018-12-21T15:56:21.000Z | 2018-12-21T15:56:21.000Z | from catalyst.contrib.registry import (
Criterion,
CRITERIONS,
Experiment,
EXPERIMENTS,
GRAD_CLIPPERS,
Model,
MODELS,
Module,
MODULES,
Optimizer,
OPTIMIZERS,
Sampler,
SAMPLERS,
Scheduler,
SCHEDULERS,
Transform,
TRANSFORMS,
)
from catalyst.core.registry... | 16.584906 | 54 | 0.634812 |
740286e93d42a0ab07a6dbfdad73bcb666cf0a20 | 5,696 | py | Python | PID/Param.py | l756302098/ros_practice | 4da8b4ddb25ada2e6f1adb3c0f8b34576aedf6b7 | [
"MIT"
] | null | null | null | PID/Param.py | l756302098/ros_practice | 4da8b4ddb25ada2e6f1adb3c0f8b34576aedf6b7 | [
"MIT"
] | null | null | null | PID/Param.py | l756302098/ros_practice | 4da8b4ddb25ada2e6f1adb3c0f8b34576aedf6b7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import random
import numpy as np
import matplotlib.pyplot as plt
# ------------------------------------------------
#
# this is the Robot class
#
class Robot(object):
def __init__(self, length=20.0):
"""
Creates robotand initializes location/or... | 17.053892 | 85 | 0.59217 |
74029f6668610eebed01b9e6004aca3a84bb3f1e | 6,660 | py | Python | sdk/storage/azure-storage-file-share/azure/storage/fileshare/_serialize.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-01-24T08:54:57.000Z | 2022-01-24T08:54:57.000Z | sdk/storage/azure-storage-file-share/azure/storage/fileshare/_serialize.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/storage/azure-storage-file-share/azure/storage/fileshare/_serialize.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
# pylint: ... | 39.642857 | 117 | 0.693243 |
7402be5579683ffa3d4e69a1f3a57521bb340df9 | 347 | py | Python | savu/plugins/unregistered/fluo_fitters/simple_fit_xrf_tools.py | elainehoml/Savu | e4772704606f71d6803d832084e10faa585e7358 | [
"Apache-2.0"
] | 39 | 2015-03-30T14:03:42.000Z | 2022-03-16T16:50:33.000Z | savu/plugins/unregistered/fluo_fitters/simple_fit_xrf_tools.py | elainehoml/Savu | e4772704606f71d6803d832084e10faa585e7358 | [
"Apache-2.0"
] | 670 | 2015-02-11T11:08:09.000Z | 2022-03-21T09:27:57.000Z | savu/plugins/unregistered/fluo_fitters/simple_fit_xrf_tools.py | elainehoml/Savu | e4772704606f71d6803d832084e10faa585e7358 | [
"Apache-2.0"
] | 54 | 2015-02-13T14:09:52.000Z | 2022-01-24T13:57:09.000Z | from savu.plugins.plugin_tools import PluginTools
class SimpleFitXrfTools(PluginTools):
"""This plugin fits XRF peaks.
"""
def define_parameters(self):
"""
width_guess:
visibility: basic
dtype: float
description: An initial guess at the width.
... | 24.785714 | 55 | 0.587896 |
7402cb2a2b8ee2c50ff20a4eea978f1f0716e937 | 14,980 | py | Python | model/modules.py | arturb90/nl2pl | 2cd37bdd7c6f9f99349f1235001a1755ba169f4a | [
"MIT"
] | null | null | null | model/modules.py | arturb90/nl2pl | 2cd37bdd7c6f9f99349f1235001a1755ba169f4a | [
"MIT"
] | null | null | null | model/modules.py | arturb90/nl2pl | 2cd37bdd7c6f9f99349f1235001a1755ba169f4a | [
"MIT"
] | 1 | 2021-07-16T09:21:15.000Z | 2021-07-16T09:21:15.000Z | import torch
from torch import nn
from torch.functional import F
from torch.nn.utils.rnn import pack_padded_sequence
from torch.nn.utils.rnn import pad_packed_sequence
class RNN(nn.Module):
'''
Base RNN module defining attributes common to both
decoder and encoder RNN's.
'''
def __init__(self,
... | 31.143451 | 74 | 0.553338 |
7402d263109ad466f103f4a15409addc32d01dde | 17,762 | py | Python | generate_example_images.py | truong225/Image-Augmentation | 4355c949792fa9ebb4fd39abb492325bba69944f | [
"MIT"
] | null | null | null | generate_example_images.py | truong225/Image-Augmentation | 4355c949792fa9ebb4fd39abb492325bba69944f | [
"MIT"
] | null | null | null | generate_example_images.py | truong225/Image-Augmentation | 4355c949792fa9ebb4fd39abb492325bba69944f | [
"MIT"
] | null | null | null | from __future__ import print_function, division
import imgaug as ia
from imgaug import augmenters as iaa
from imgaug import parameters as iap
import numpy as np
from scipy import ndimage, misc
from skimage import data
import matplotlib.pyplot as plt
from matplotlib import gridspec
import six
import six.moves as sm
np.... | 61.037801 | 239 | 0.576793 |
7402e2dcc16b065674a93363be738347a5e36084 | 5,160 | py | Python | oddt/scoring/functions/NNScore.py | mwojcikowski/oddt | 3b58b15b530e97a90d958fe8b862f16605b6da1f | [
"BSD-3-Clause"
] | null | null | null | oddt/scoring/functions/NNScore.py | mwojcikowski/oddt | 3b58b15b530e97a90d958fe8b862f16605b6da1f | [
"BSD-3-Clause"
] | 2 | 2019-05-30T11:00:58.000Z | 2019-06-14T18:56:55.000Z | oddt/scoring/functions/NNScore.py | mwojcikowski/oddt | 3b58b15b530e97a90d958fe8b862f16605b6da1f | [
"BSD-3-Clause"
] | 2 | 2019-03-28T14:18:40.000Z | 2019-03-29T12:47:39.000Z | from __future__ import print_function
import sys
from os.path import dirname, isfile, join as path_join
import numpy as np
import warnings
from joblib import Parallel, delayed
from scipy.stats import pearsonr
from sklearn.metrics import r2_score
from oddt import random_seed
from oddt.utils import method_caller
from o... | 38.796992 | 83 | 0.577519 |
7402f3d42f2de7c74e4d5d57a369afdb2b00e6c4 | 2,213 | py | Python | venv/Lib/site-packages/pyrogram/raw/functions/messages/get_emoji_keywords.py | D1ne2021/jjhhhjj | a090da30983b3ef276dfe4cef2ded4526f36002a | [
"MIT"
] | 2 | 2021-12-13T07:09:55.000Z | 2022-01-12T12:15:20.000Z | venv/Lib/site-packages/pyrogram/raw/functions/messages/get_emoji_keywords.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pyrogram/raw/functions/messages/get_emoji_keywords.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | # Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2021 Dan <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free... | 30.736111 | 103 | 0.630366 |
7403005a2961e783c3faf2c7eb37b39ac6eca4ab | 1,896 | py | Python | ninfs/reg_shell.py | Jhynjhiruu/ninfs | 9e0f5889cafd595c56e2db936177ef1b0f4ac02e | [
"MIT"
] | 213 | 2019-04-18T04:43:18.000Z | 2022-03-29T06:25:38.000Z | ninfs/reg_shell.py | Jhynjhiruu/ninfs | 9e0f5889cafd595c56e2db936177ef1b0f4ac02e | [
"MIT"
] | 55 | 2019-04-20T01:21:26.000Z | 2022-03-26T02:40:17.000Z | ninfs/reg_shell.py | Jhynjhiruu/ninfs | 9e0f5889cafd595c56e2db936177ef1b0f4ac02e | [
"MIT"
] | 17 | 2019-05-11T22:15:31.000Z | 2021-10-06T03:46:51.000Z | # This file is a part of ninfs.
#
# Copyright (c) 2017-2021 Ian Burgwin
# This file is licensed under The MIT License (MIT).
# You can find the full license text in LICENSE.md in the root of this project.
from sys import executable
from os import remove
from os.path import abspath, dirname
from subprocess import Popen... | 31.081967 | 117 | 0.683017 |
7403168d5b29b3bef228efab30fcf9d700873215 | 506 | py | Python | django_auth_policy/tests/urls.py | fox-it/django-auth-policy | 6dbd1056bb01bf938c7ce937f5a14a949959dc7f | [
"BSD-3-Clause"
] | 5 | 2017-09-05T13:31:53.000Z | 2020-03-21T23:33:58.000Z | django_auth_policy/tests/urls.py | fox-it/django-auth-policy | 6dbd1056bb01bf938c7ce937f5a14a949959dc7f | [
"BSD-3-Clause"
] | 1 | 2015-11-16T22:36:54.000Z | 2015-11-16T22:37:25.000Z | django_auth_policy/tests/urls.py | fox-it/django-auth-policy | 6dbd1056bb01bf938c7ce937f5a14a949959dc7f | [
"BSD-3-Clause"
] | 3 | 2018-03-16T19:17:11.000Z | 2021-04-20T15:02:04.000Z | from django import http
from django.conf.urls import patterns, url
from django.contrib.auth.decorators import login_required
from django_auth_policy.urls import urlpatterns
@login_required
def login_required_view(request):
return http.HttpResponse('ok')
def another_view(request):
return http.HttpResponse('a... | 26.631579 | 64 | 0.762846 |
74036f9685c9e124f01a98eeda9aa03a98bcf1ea | 6,307 | py | Python | dakotathon/tests/test_method_base_uq.py | csdms/dakotathon | 6af575b0c21384b2a1ab51e26b6a08512313bd84 | [
"MIT"
] | 8 | 2019-09-11T12:59:57.000Z | 2021-08-11T16:31:58.000Z | dakotathon/tests/test_method_base_uq.py | csdms/dakota | 6af575b0c21384b2a1ab51e26b6a08512313bd84 | [
"MIT"
] | 66 | 2015-04-06T17:11:21.000Z | 2019-02-03T18:09:52.000Z | dakotathon/tests/test_method_base_uq.py | csdms/dakota | 6af575b0c21384b2a1ab51e26b6a08512313bd84 | [
"MIT"
] | 5 | 2015-03-24T22:39:34.000Z | 2018-04-21T12:14:05.000Z | """Tests for dakotathon.method.base.UncertaintyQuantificationBase."""
import sys
from nose.tools import raises, assert_true, assert_equal, assert_is_none
from dakotathon.method.base import UncertaintyQuantificationBase, _print_levels
class Concrete(UncertaintyQuantificationBase):
"""A subclass of UncertaintyQua... | 25.848361 | 79 | 0.69082 |
740372cd5db7175901ece1bc57f45424f10b84e3 | 1,397 | py | Python | OOP_concepts/class_method.py | SeanSyue/PythonReferences | 103b2d6934a33e56a5d8fbb14d95282f572b3af7 | [
"MIT"
] | null | null | null | OOP_concepts/class_method.py | SeanSyue/PythonReferences | 103b2d6934a33e56a5d8fbb14d95282f572b3af7 | [
"MIT"
] | null | null | null | OOP_concepts/class_method.py | SeanSyue/PythonReferences | 103b2d6934a33e56a5d8fbb14d95282f572b3af7 | [
"MIT"
] | null | null | null | # https://youtu.be/rq8cL2XMM5M
# Class methods can be seen as additional constructors.
class Employee:
"""
Class object of employee information.
"""
# Class variable:
raise_amt = 1.05
# Instance variable (or static variable) :
num_of_emps = 0
def __init__(self, first, last, pay):
... | 24.508772 | 69 | 0.657838 |
74038bc05dbac0a17f87b34b1fa590c91234a763 | 14,046 | py | Python | Lib/site-packages/wx-3.0-msw/wx/lib/langlistctrl.py | jickieduan/python27 | c752b552396bbed68d8555080d475718cea2edd0 | [
"bzip2-1.0.6"
] | 1 | 2021-02-13T22:40:50.000Z | 2021-02-13T22:40:50.000Z | Lib/site-packages/wx-3.0-msw/wx/lib/langlistctrl.py | jickieduan/python27 | c752b552396bbed68d8555080d475718cea2edd0 | [
"bzip2-1.0.6"
] | 1 | 2018-07-28T20:07:04.000Z | 2018-07-30T18:28:34.000Z | Lib/site-packages/wx-3.0-msw/wx/lib/langlistctrl.py | jickieduan/python27 | c752b552396bbed68d8555080d475718cea2edd0 | [
"bzip2-1.0.6"
] | 2 | 2019-12-02T01:39:10.000Z | 2021-02-13T22:41:00.000Z | #-----------------------------------------------------------------------------
# Name: languagectrls.py
# Purpose:
#
# Author: Riaan Booysen
#
# Created: 2006
# RCS-ID: $Id$
# Copyright: (c) 2006 Riaan Booysen
# License: wxPython
#---------------------------------------------------------... | 33.049412 | 95 | 0.624021 |
740393a0ff4b567f450c59788ea748c7a489f51c | 3,759 | py | Python | django_project/app/views_common.py | ryoma-jp/AI_Dashboard | 840c6ea9ee1ec82e46c2d6470643031c79aaa1d4 | [
"MIT"
] | null | null | null | django_project/app/views_common.py | ryoma-jp/AI_Dashboard | 840c6ea9ee1ec82e46c2d6470643031c79aaa1d4 | [
"MIT"
] | null | null | null | django_project/app/views_common.py | ryoma-jp/AI_Dashboard | 840c6ea9ee1ec82e46c2d6470643031c79aaa1d4 | [
"MIT"
] | null | null | null | import os
import fcntl
import logging
import json
import pickle
from django.conf import settings
from app.models import Project, MlModel
from machine_learning.lib.data_loader.data_loader import DataLoaderCIFAR10, DataLoaderMNIST, DataLoaderCustom
# Create your views here.
class SidebarActiveStatus():
""" Class... | 29.598425 | 109 | 0.613195 |
7403bf375bcb64b8e5dde5922afe5fabd05947c3 | 9,154 | py | Python | tfrecord.py | ShiChenAI/cnn_implementation | 9e15179b2bc3b9bd4a55c825873af8ebaf0caef3 | [
"Apache-2.0"
] | 1 | 2018-12-19T10:40:54.000Z | 2018-12-19T10:40:54.000Z | tfrecord.py | ShiChenAI/cnn_implementation | 9e15179b2bc3b9bd4a55c825873af8ebaf0caef3 | [
"Apache-2.0"
] | null | null | null | tfrecord.py | ShiChenAI/cnn_implementation | 9e15179b2bc3b9bd4a55c825873af8ebaf0caef3 | [
"Apache-2.0"
] | null | null | null | import tensorflow as tf
import os
import sys
import time
import random
from PIL import Image
import config
IMAGE_HEIGHT = int(config.get_configs('global.conf', 'dataset', 'resize_image_height'))
IMAGE_WIDTH = int(config.get_configs('global.conf', 'dataset', 'resize_image_width'))
CHANNELS = int(config.get_configs('g... | 34.674242 | 119 | 0.646821 |
7403dfcd053fa08e1436779164e4a724a0d08a94 | 1,740 | py | Python | demo/xmlproc/dtdcmd.py | jkloth/pyxml | de15b3ad0fe095f6ce36b1c5ad7438046aae8d3d | [
"MIT"
] | 2 | 2018-05-28T23:01:20.000Z | 2018-05-29T03:59:38.000Z | demo/xmlproc/dtdcmd.py | jkloth/pyxml | de15b3ad0fe095f6ce36b1c5ad7438046aae8d3d | [
"MIT"
] | null | null | null | demo/xmlproc/dtdcmd.py | jkloth/pyxml | de15b3ad0fe095f6ce36b1c5ad7438046aae8d3d | [
"MIT"
] | null | null | null | #!/usr/bin/python
"""
A simple command-line interface to the DTD parser. Intended for those rare
cases when one wants to just parse a DTD and nothing more.
"""
import sys, getopt
from xml.parsers.xmlproc import xmlproc,dtdparser,utils,xmldtd
# --- Doco
usage=\
"""
Usage:
python dtdcmd.py [--list] <urltodtd>+
... | 17.4 | 74 | 0.643103 |
7403fd9f42ffc2e8d0631a7c444c538913da8553 | 5,746 | py | Python | sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_09_01/models/_web_site_management_client_enums.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2021-09-07T18:39:05.000Z | 2021-09-07T18:39:05.000Z | sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_09_01/models/_web_site_management_client_enums.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_09_01/models/_web_site_management_client_enums.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 28.445545 | 95 | 0.678211 |
7403fde2dc73d765b0e3ff238c146341b238007b | 27,216 | py | Python | projects/DensePose/distribution_keypoints_densepose.py | tintinrevient/detectron2 | 59069d9a20104ca2eb87773ba39280d522f2e345 | [
"Apache-2.0"
] | null | null | null | projects/DensePose/distribution_keypoints_densepose.py | tintinrevient/detectron2 | 59069d9a20104ca2eb87773ba39280d522f2e345 | [
"Apache-2.0"
] | null | null | null | projects/DensePose/distribution_keypoints_densepose.py | tintinrevient/detectron2 | 59069d9a20104ca2eb87773ba39280d522f2e345 | [
"Apache-2.0"
] | null | null | null | import cv2
import numpy as np
import os
from densepose.structures import DensePoseDataRelative
from infer_segm import _calc_angle, _rotate, _euclidian, COARSE_TO_COLOR
from distribution_segm import (
coco_folder, dp_coco, image_w_and_h,
_is_valid, _translate_keypoints_to_bbox, get_img_ids_by_caption, get_img_id... | 39.32948 | 118 | 0.70352 |
7404142e0954de33ab435a642336adf47ee08c95 | 6,937 | py | Python | trdg/computer_text_generator.py | srividya-p/TextRecognitionDataGenerator | cfba3ef1b5204c5f45d347c1c3db09a77dd3cd01 | [
"MIT"
] | null | null | null | trdg/computer_text_generator.py | srividya-p/TextRecognitionDataGenerator | cfba3ef1b5204c5f45d347c1c3db09a77dd3cd01 | [
"MIT"
] | null | null | null | trdg/computer_text_generator.py | srividya-p/TextRecognitionDataGenerator | cfba3ef1b5204c5f45d347c1c3db09a77dd3cd01 | [
"MIT"
] | null | null | null | import random as rnd
from PIL import Image, ImageColor, ImageFont, ImageDraw, ImageFilter
def generate(
text, font, text_color, font_size, orientation, space_width, character_spacing, fit, word_split
):
if orientation == 0:
return _generate_horizontal_text(
text, font, text_color, font_si... | 38.325967 | 151 | 0.570564 |
740419431fdf1905a7d605b42c5fb24125764ec5 | 3,843 | py | Python | sdk/metricsadvisor/azure-ai-metricsadvisor/tests/async_tests/test_data_feed_ingestion_async.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2021-09-07T18:39:05.000Z | 2021-09-07T18:39:05.000Z | sdk/metricsadvisor/azure-ai-metricsadvisor/tests/async_tests/test_data_feed_ingestion_async.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/metricsadvisor/azure-ai-metricsadvisor/tests/async_tests/test_data_feed_ingestion_async.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.000Z | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import da... | 43.670455 | 108 | 0.669529 |
74043a3d8f09cbc3e17ae32d5ddc0426a9ba2610 | 12,436 | py | Python | scripts/release_scripts/wrap_up_release_test.py | OsamaAdam98/oppia | 9c9c3d0fc6710f58394c5e28d414043340ed2a62 | [
"Apache-2.0"
] | 2 | 2019-03-31T07:03:32.000Z | 2019-04-24T18:12:53.000Z | scripts/release_scripts/wrap_up_release_test.py | OsamaAdam98/oppia | 9c9c3d0fc6710f58394c5e28d414043340ed2a62 | [
"Apache-2.0"
] | 3 | 2020-03-16T06:40:30.000Z | 2020-03-30T12:10:20.000Z | scripts/release_scripts/wrap_up_release_test.py | RafayGhafoor/oppia | 855d02414ca00d0807d841e48be7ce7b94d68c29 | [
"Apache-2.0"
] | 2 | 2019-12-02T18:56:56.000Z | 2020-03-16T08:03:45.000Z | # coding: utf-8
#
# Copyright 2019 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 43.180556 | 80 | 0.657527 |
74044bdabfb1ffbad3523a358c4f3d5b535d8bfe | 4,797 | py | Python | src/examples/pin/crackme_hash_collision.py | flokli/Triton | db520a9da012b28f23321ff082aa810e1f1552ff | [
"Apache-2.0"
] | 2 | 2019-08-01T06:58:30.000Z | 2020-03-28T04:38:12.000Z | src/examples/pin/crackme_hash_collision.py | Ahmadmansoor/Triton | e1a8538ee1512999589f58c0272f0ee33f33c377 | [
"Apache-2.0"
] | null | null | null | src/examples/pin/crackme_hash_collision.py | Ahmadmansoor/Triton | e1a8538ee1512999589f58c0272f0ee33f33c377 | [
"Apache-2.0"
] | 1 | 2018-10-09T12:08:44.000Z | 2018-10-09T12:08:44.000Z |
from triton import ARCH, CPUSIZE
from pintool import *
#
# This example breaks a simple hash routine.
#
# Check the ./src/samples/crackmes/crackme_hash.c file. This file builds
# a 'hash' and checks the checksum 0xad6d.
#
# The needed password is 'elite'. Example:
# $ ./src/samples/crackmes/crackme_hash elite
... | 50.494737 | 119 | 0.571399 |
740451dae157361436c76c4725d9f900a6322da4 | 26,331 | py | Python | LAB3/ReinforcementLearning/pacman.py | Yalfoosh/UI-Labosi | 6c8f5796cafe603012ae94b9bd2adf4642c6a1e2 | [
"Apache-2.0"
] | 21 | 2019-02-11T03:04:48.000Z | 2022-01-30T08:36:19.000Z | LAB3/ReinforcementLearning/pacman.py | Yalfoosh/UI-Labosi | 6c8f5796cafe603012ae94b9bd2adf4642c6a1e2 | [
"Apache-2.0"
] | 1 | 2018-10-25T10:45:52.000Z | 2018-10-25T10:45:52.000Z | LAB3/ReinforcementLearning/pacman.py | Yalfoosh/UI-Labosi | 6c8f5796cafe603012ae94b9bd2adf4642c6a1e2 | [
"Apache-2.0"
] | 38 | 2018-09-25T09:50:38.000Z | 2022-02-08T01:10:09.000Z | # pacman.py
# ---------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribution to UC Berkeley, including a link to http://ai.berkeley.edu.
#
# A... | 38.439416 | 119 | 0.617485 |
7404c8e17a69d64f0527cf31a276b81b910e5171 | 205 | py | Python | api/ver1/parties/strings.py | pcf26536/politico-api | 1c9b8755ddad2baf0bfdeab4aa0674e4197a0d7c | [
"MIT"
] | 1 | 2019-02-22T19:34:32.000Z | 2019-02-22T19:34:32.000Z | api/ver1/parties/strings.py | pcf26536/politico-api | 1c9b8755ddad2baf0bfdeab4aa0674e4197a0d7c | [
"MIT"
] | null | null | null | api/ver1/parties/strings.py | pcf26536/politico-api | 1c9b8755ddad2baf0bfdeab4aa0674e4197a0d7c | [
"MIT"
] | 1 | 2019-02-07T22:12:25.000Z | 2019-02-07T22:12:25.000Z | """ string constants for parties module """
hqAddKey = 'hqAddress'
logoUrlKey = 'logoUrl'
party_id_key = 'party_id'
party_id_str = 'Party ID '
party_key = 'party'
imageTypes = ['png', 'jpg', 'gif']
| 25.625 | 44 | 0.668293 |
7404e7e5acc809c392bcf48ce3a045c89b3f8fb9 | 70,738 | py | Python | API/src/main/resources/Lib/robot/libraries/XML.py | TagExpress/SikuliX1 | de9da11794dd94b3821eddc5c01b534d3f2fe828 | [
"MIT"
] | null | null | null | API/src/main/resources/Lib/robot/libraries/XML.py | TagExpress/SikuliX1 | de9da11794dd94b3821eddc5c01b534d3f2fe828 | [
"MIT"
] | null | null | null | API/src/main/resources/Lib/robot/libraries/XML.py | TagExpress/SikuliX1 | de9da11794dd94b3821eddc5c01b534d3f2fe828 | [
"MIT"
] | null | null | null | # Copyright (c) 2010-2020, sikuli.org, sikulix.com - MIT license
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 46.815354 | 191 | 0.62559 |
7404fa15f231e1d2e877ed8410dccb13510e8ee9 | 5,217 | py | Python | summarization/generator/multinomial.py | ggianna/ProbNGGSummarization | 2af54bb6338c9e702cdf562aaeb0982d1b0a228a | [
"Apache-2.0"
] | null | null | null | summarization/generator/multinomial.py | ggianna/ProbNGGSummarization | 2af54bb6338c9e702cdf562aaeb0982d1b0a228a | [
"Apache-2.0"
] | null | null | null | summarization/generator/multinomial.py | ggianna/ProbNGGSummarization | 2af54bb6338c9e702cdf562aaeb0982d1b0a228a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
__project__ = 'textsummary'
__author__ = 'Alfio Ferrara'
__email__ = 'alfio.ferrara@unimi.it'
__institution__ = 'Università degli Studi di Milano'
__date__ = '19 giu 2017'
__comment__ = '''
Classes for generating summaries by multinomial language models
'''
import numpy as np
import stri... | 39.522727 | 103 | 0.57581 |
740564d07ccc17298b60cd217c115eea24a1864d | 286 | py | Python | random/diffeqcond.py | sgherbst/msdsl | e38d5ecdb88b3574bda62f22a4f91ce3e4173d12 | [
"MIT"
] | 15 | 2019-05-14T10:12:23.000Z | 2022-03-29T15:29:52.000Z | random/diffeqcond.py | sgherbst/msdsl | e38d5ecdb88b3574bda62f22a4f91ce3e4173d12 | [
"MIT"
] | 19 | 2020-01-22T21:44:33.000Z | 2021-06-05T02:10:41.000Z | random/diffeqcond.py | sgherbst/msdsl | e38d5ecdb88b3574bda62f22a4f91ce3e4173d12 | [
"MIT"
] | 5 | 2019-10-21T09:53:17.000Z | 2021-08-10T17:32:20.000Z | from msdsl import *
r, rsw, c = 1e3, 100, 1e-9
m = MixedSignalModel('rc', dt=0.1e-6)
x = m.add_analog_input('x')
s = m.add_digital_input('s')
y = m.add_analog_output('y')
g = eqn_case([1/r, 1/r+1/rsw], [s])
m.add_eqn_sys([c*Deriv(y) == (x-y)*g])
m.compile_and_print(VerilogGenerator())
| 28.6 | 39 | 0.653846 |
74057b0966417e615b6b5351e7d089b2a07ebaa2 | 552 | py | Python | Medium/2149 Rearrange Array Elements by Sign.py | raj713335/LeetCode | e60e145d90f45d37e148e8307a3d97f5f0741de0 | [
"Apache-2.0"
] | null | null | null | Medium/2149 Rearrange Array Elements by Sign.py | raj713335/LeetCode | e60e145d90f45d37e148e8307a3d97f5f0741de0 | [
"Apache-2.0"
] | null | null | null | Medium/2149 Rearrange Array Elements by Sign.py | raj713335/LeetCode | e60e145d90f45d37e148e8307a3d97f5f0741de0 | [
"Apache-2.0"
] | null | null | null | # https://leetcode.com/problems/rearrange-array-elements-by-sign/
class Solution:
def rearrangeArray(self, nums: List[int]) -> List[int]:
positive = []
negative = []
result = []
for each in nums:
if each < 0:
negative.append(eac... | 24 | 65 | 0.476449 |
7405e3f261837a685de61a9ff4b1b8ad7fa6cb2f | 3,037 | py | Python | main/model/config.py | carbon-tools/upup | 593bc276390a859447a1c282869a28e0f7a29c06 | [
"MIT"
] | 1 | 2018-05-20T17:30:53.000Z | 2018-05-20T17:30:53.000Z | main/model/config.py | carbon-tools/upup | 593bc276390a859447a1c282869a28e0f7a29c06 | [
"MIT"
] | null | null | null | main/model/config.py | carbon-tools/upup | 593bc276390a859447a1c282869a28e0f7a29c06 | [
"MIT"
] | 1 | 2021-03-25T04:57:27.000Z | 2021-03-25T04:57:27.000Z | # coding: utf-8
from __future__ import absolute_import
from google.appengine.ext import ndb
from api import fields
import config
import model
import util
class Config(model.Base, model.ConfigAuth):
analytics_id = ndb.StringProperty(default='', verbose_name='Tracking ID')
announcement_html = ndb.TextProperty(de... | 42.180556 | 120 | 0.772802 |
740603e41b1f2dcbd16e38d95e85b215575cc282 | 63,222 | py | Python | windse/WindFarmManager.py | jefalon/WindSE | bf7e0dbad85552b32327bda2b5c29a0fac5286bb | [
"Apache-2.0"
] | 35 | 2019-07-14T17:08:10.000Z | 2022-03-15T11:09:44.000Z | windse/WindFarmManager.py | jefalon/WindSE | bf7e0dbad85552b32327bda2b5c29a0fac5286bb | [
"Apache-2.0"
] | 45 | 2020-11-16T16:40:12.000Z | 2022-03-30T20:04:37.000Z | windse/WindFarmManager.py | jefalon/WindSE | bf7e0dbad85552b32327bda2b5c29a0fac5286bb | [
"Apache-2.0"
] | 21 | 2020-02-11T12:01:36.000Z | 2022-03-18T19:07:14.000Z | """
The windfarm manager contains everything required to set up a
windfarm.
"""
import __main__
import os
### Get the name of program importing this package ###
if hasattr(__main__,"__file__"):
main_file = os.path.basename(__main__.__file__)
else:
main_file = "ipython"
### This checks if we are just doi... | 39.146749 | 168 | 0.545158 |
740615013fb234cd0794734325185872e28ffefe | 2,312 | py | Python | smt/sampling_methods/tests/test_lhs.py | anfelopera/smt | 63f58afe94f911550ae3aa21860e26ead5f61d50 | [
"BSD-3-Clause"
] | null | null | null | smt/sampling_methods/tests/test_lhs.py | anfelopera/smt | 63f58afe94f911550ae3aa21860e26ead5f61d50 | [
"BSD-3-Clause"
] | null | null | null | smt/sampling_methods/tests/test_lhs.py | anfelopera/smt | 63f58afe94f911550ae3aa21860e26ead5f61d50 | [
"BSD-3-Clause"
] | null | null | null | import unittest
import numpy as np
from smt.sampling_methods import LHS
class Test(unittest.TestCase):
def test_lhs_ese(self):
xlimits = np.array([[0.0, 4.0], [0.0, 3.0]])
sampling = LHS(xlimits=xlimits, criterion="ese")
num = 50
x = sampling(num)
self.assertEqual((50, 2)... | 30.025974 | 88 | 0.472751 |
74062b9bb7e26c8bc67ef20831fc72c598b16264 | 9,926 | py | Python | release/scripts/mgear/shifter/io.py | mgear-dev/mgear4 | dc41909af58967ff8afb688988171fb94b775e8f | [
"MIT"
] | 72 | 2020-09-28T20:00:59.000Z | 2022-03-25T14:35:14.000Z | release/scripts/mgear/shifter/io.py | mgear-dev/mgear4 | dc41909af58967ff8afb688988171fb94b775e8f | [
"MIT"
] | 101 | 2020-09-28T19:53:53.000Z | 2022-03-31T01:44:41.000Z | release/scripts/mgear/shifter/io.py | mgear-dev/mgear4 | dc41909af58967ff8afb688988171fb94b775e8f | [
"MIT"
] | 32 | 2020-10-09T10:49:45.000Z | 2022-03-31T08:27:37.000Z | # Shifter guides IO utility functions
import os
import json
import sys
import pymel.core as pm
from mgear import shifter
from mgear.core import curve
if sys.version_info[0] == 2:
string_types = (basestring, )
else:
string_types = (str,)
def get_guide_template_dict(guide_node, meta=None):
"""Get the guide... | 34.706294 | 79 | 0.582813 |
74066dccc7564cfd48b236dd47ad5edd3340ad3f | 1,178 | py | Python | google-cloud-sdk/lib/surface/ml/models/versions/set_default.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | 1 | 2017-11-29T18:52:27.000Z | 2017-11-29T18:52:27.000Z | google-cloud-sdk/.install/.backup/lib/surface/ml/models/versions/set_default.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | null | null | null | google-cloud-sdk/.install/.backup/lib/surface/ml/models/versions/set_default.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | 1 | 2020-07-25T12:09:01.000Z | 2020-07-25T12:09:01.000Z | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 39.266667 | 74 | 0.745331 |
740684320bf855530afca696543e669a0fa66835 | 1,964 | py | Python | heap/merge_sorted_k_lists.py | AnshulPatni/Algorithms | c8bcfb86d50f68041921e5140f01821ac12d9521 | [
"MIT"
] | 2 | 2018-04-30T19:31:04.000Z | 2018-05-05T14:29:45.000Z | heap/merge_sorted_k_lists.py | AnshulPatni/Algorithms | c8bcfb86d50f68041921e5140f01821ac12d9521 | [
"MIT"
] | null | null | null | heap/merge_sorted_k_lists.py | AnshulPatni/Algorithms | c8bcfb86d50f68041921e5140f01821ac12d9521 | [
"MIT"
] | 1 | 2018-04-16T12:45:49.000Z | 2018-04-16T12:45:49.000Z | """
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.
"""
from heapq import heappop, heapreplace, heapify
from queue import PriorityQueue
# Definition for singly-linked list.
class ListNode(object):
def __init__(self, x):
self.val = x
self.next = ... | 28.463768 | 98 | 0.64664 |
74071d9fcf68368bdb9c63b14b14b0a760e7b010 | 5,670 | py | Python | tests/test_pytimings.py | WWU-AMM/pytimings | 0a1b2a84e2820e5d9b447099f76b1a735663820b | [
"BSD-3-Clause"
] | null | null | null | tests/test_pytimings.py | WWU-AMM/pytimings | 0a1b2a84e2820e5d9b447099f76b1a735663820b | [
"BSD-3-Clause"
] | 14 | 2021-02-16T08:07:59.000Z | 2021-11-30T11:51:58.000Z | tests/test_pytimings.py | WWU-AMM/pytimings | 0a1b2a84e2820e5d9b447099f76b1a735663820b | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
"""Tests for `pytimings` package."""
import pickle
import numpy as np
from functools import partial
from tempfile import TemporaryFile
from click.testing import CliRunner
from pytimings import cli
from pytimings.timer import scoped_timing, cummulative_scoped_timing, function_timer
from pytiming... | 35.660377 | 108 | 0.727513 |
74072558e54e875637eb75110ac65618a9b42690 | 2,390 | py | Python | tests/python/test_input_parser.py | AntaresSimulatorTeam/antares-xpansion | 1aa5775e78d35dd07fc4bd6d0423ce534adf0816 | [
"Apache-2.0"
] | 5 | 2021-08-25T09:29:14.000Z | 2022-03-09T08:59:07.000Z | tests/python/test_input_parser.py | AntaresSimulatorTeam/antares-xpansion | 1aa5775e78d35dd07fc4bd6d0423ce534adf0816 | [
"Apache-2.0"
] | 251 | 2020-10-30T09:49:29.000Z | 2022-03-31T12:28:48.000Z | tests/python/test_input_parser.py | AntaresSimulatorTeam/antares-xpansion | 1aa5775e78d35dd07fc4bd6d0423ce534adf0816 | [
"Apache-2.0"
] | 5 | 2020-12-16T15:11:33.000Z | 2021-06-18T05:03:59.000Z | import pytest
from antares_xpansion.input_parser import InputParser
from antares_xpansion.xpansionConfig import InputParameters
class TestInputParser:
def setup_method(self):
self.default_parameters = {"step" :"full"}
def test_empty_input_raises_error(self):
my_parser = InputParser()
... | 34.637681 | 78 | 0.668619 |
740742fe8c7bb751db579cad4d24532abdbdb09c | 689 | py | Python | cloudmesh/util/ping.py | JulienPalard/cloudmesh | 1759b88daef3a13917492d028fdabe08f03ca996 | [
"Apache-2.0"
] | null | null | null | cloudmesh/util/ping.py | JulienPalard/cloudmesh | 1759b88daef3a13917492d028fdabe08f03ca996 | [
"Apache-2.0"
] | 4 | 2021-06-08T20:20:08.000Z | 2022-03-11T23:30:22.000Z | cloudmesh/util/ping.py | JulienPalard/cloudmesh | 1759b88daef3a13917492d028fdabe08f03ca996 | [
"Apache-2.0"
] | null | null | null | '''Ping a machine'''
import sh
def ping(host):
'''ping the specified host.
:param host: the name or ip of the host
'''
try:
result = sh.ping("-o", "-c", "1", host).strip().split("\n")
except:
pass
try:
(attributes, values) = result[-1].replace("round-trip", "")\
... | 20.878788 | 75 | 0.512337 |
7407681a2c01aa87383dbc9da695282ee8dfde08 | 3,480 | py | Python | python/domain/bio2019/content/ch05.py | ICTU/document-as-code | e65fddb94513e7c2f54f248b4ce69e9e10ce42f5 | [
"Apache-2.0"
] | 2 | 2021-01-09T17:00:51.000Z | 2021-02-19T09:35:26.000Z | python/domain/bio2019/content/ch05.py | ICTU/document-as-code | e65fddb94513e7c2f54f248b4ce69e9e10ce42f5 | [
"Apache-2.0"
] | null | null | null | python/domain/bio2019/content/ch05.py | ICTU/document-as-code | e65fddb94513e7c2f54f248b4ce69e9e10ce42f5 | [
"Apache-2.0"
] | 1 | 2020-02-24T15:50:05.000Z | 2020-02-24T15:50:05.000Z | # -*- coding: latin-1 -*-
"""
fragments - define text fragments in the document
"""
from domain.norm_document.model import Chapter, Section, Norm, Verifier
CH05S01 = Section(
identifier="05.01",
title="Aansturing door de directie van de informatiebeveiliging",
text="Doelstelling: Het verschaffen van d... | 45.789474 | 120 | 0.575575 |
740769fada521b9f56e4d14c8742e9715c6ca69f | 3,342 | py | Python | figure/4/extract_ROI.py | XinhuiLi/PipelineHarmonization | 701f84841528d3e50c5538b2de244ee36eedd7d6 | [
"Apache-2.0"
] | 7 | 2021-11-11T19:18:19.000Z | 2022-03-15T13:53:49.000Z | figure/4/extract_ROI.py | XinhuiLi/PipelineHarmonization | 701f84841528d3e50c5538b2de244ee36eedd7d6 | [
"Apache-2.0"
] | 1 | 2021-11-18T05:23:30.000Z | 2021-11-19T20:31:53.000Z | figure/4/extract_ROI.py | XinhuiLi/PipelineHarmonization | 701f84841528d3e50c5538b2de244ee36eedd7d6 | [
"Apache-2.0"
] | 1 | 2022-01-06T06:29:56.000Z | 2022-01-06T06:29:56.000Z | import os
import glob
import nibabel as nb
DATA_INPUT_DIR = os.environ.get('DATA_INPUT_DIR')
DATA_OUTPUT_DIR = os.environ.get('DATA_OUTPUT_DIR')
PH_SERVER_WORKING_ROOT = os.environ.get('PH_SERVER_WORKING_ROOT')
orig_path = f'{DATA_INPUT_DIR}source_of_var'
output_data_path = f'{DATA_OUTPUT_DIR}/data'
output_roi_path =... | 42.846154 | 169 | 0.617594 |
74076adee6ddc0e3e582e63309405e2ee7d65cf7 | 2,192 | py | Python | torchesn/utils/utilities.py | ByteSumoLtd/pytorch-esn | 00525e076f066e7ee5bd77b78bc607ea2651a10a | [
"MIT"
] | 2 | 2020-06-06T19:59:35.000Z | 2020-06-17T13:23:35.000Z | torchesn/utils/utilities.py | ByteSumoLtd/pytorch-esn | 00525e076f066e7ee5bd77b78bc607ea2651a10a | [
"MIT"
] | null | null | null | torchesn/utils/utilities.py | ByteSumoLtd/pytorch-esn | 00525e076f066e7ee5bd77b78bc607ea2651a10a | [
"MIT"
] | null | null | null | import torch
def prepare_target(target, seq_lengths, washout, batch_first=False):
""" Preprocess target for offline training.
Args:
target (seq_len, batch, output_size): tensor containing
the features of the target sequence.
seq_lengths: list of lengths of each sequence in the bat... | 35.354839 | 89 | 0.637774 |
740771c294685396e56f42cb7cc84dd144b04d4a | 4,081 | py | Python | inference.py | kelvinliu04/Udacity-People-Counter | 7ee150604a90866a96f8f7f4e7d62df3ae5eb84a | [
"MIT"
] | null | null | null | inference.py | kelvinliu04/Udacity-People-Counter | 7ee150604a90866a96f8f7f4e7d62df3ae5eb84a | [
"MIT"
] | null | null | null | inference.py | kelvinliu04/Udacity-People-Counter | 7ee150604a90866a96f8f7f4e7d62df3ae5eb84a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
Copyright (c) 2018 Intel Corporation.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, mod... | 39.621359 | 92 | 0.667728 |
7407d34870a64fe98ff8b613c9e1dbf23c7c0169 | 1,253 | py | Python | agent/windows/src/agent.py | liaojiacan/dyanmic-host | 0b47d8fa5b596e3e3d82d75992a00a97a9d4f457 | [
"MIT"
] | 4 | 2018-02-11T09:53:22.000Z | 2022-03-06T06:35:41.000Z | agent/windows/src/agent.py | liaojiacan/dyanmic-host | 0b47d8fa5b596e3e3d82d75992a00a97a9d4f457 | [
"MIT"
] | null | null | null | agent/windows/src/agent.py | liaojiacan/dyanmic-host | 0b47d8fa5b596e3e3d82d75992a00a97a9d4f457 | [
"MIT"
] | 1 | 2020-12-11T07:03:38.000Z | 2020-12-11T07:03:38.000Z | import socket
from urllib import request,parse
import platform
class Agent:
def __init__(self,agent_key,server,scheme):
self.agent_key = agent_key
self.server = server
self.scheme = scheme
self.report_url = "%s://%s/public/v1/agents/%s"%(scheme,server,agent_key)
def getLoca... | 28.477273 | 81 | 0.565842 |
7407df6916b60993d866784a70996630548f0340 | 15,738 | py | Python | python/eggroll/roll_paillier_tensor/roll_paillier_tensor.py | ZYKJShadow/eggroll | 02b845c46cfb7a67459c6d842fa9ef3a02ae60ba | [
"Apache-2.0"
] | 1 | 2020-10-23T03:18:54.000Z | 2020-10-23T03:18:54.000Z | python/eggroll/roll_paillier_tensor/roll_paillier_tensor.py | ZYKJShadow/eggroll | 02b845c46cfb7a67459c6d842fa9ef3a02ae60ba | [
"Apache-2.0"
] | null | null | null | python/eggroll/roll_paillier_tensor/roll_paillier_tensor.py | ZYKJShadow/eggroll | 02b845c46cfb7a67459c6d842fa9ef3a02ae60ba | [
"Apache-2.0"
] | null | null | null | import uuid
from concurrent.futures.thread import ThreadPoolExecutor
from threading import Thread
from eggroll.core.aspects import _method_profile_logger
from eggroll.core.command.command_model import ErCommandRequest
from eggroll.core.constants import StoreTypes
from eggroll.core.io.kv_adapter import RocksdbSortedKvA... | 42.306452 | 116 | 0.652878 |
7408070186c9efb32f6d779229fcbeaec6509c2e | 2,530 | py | Python | src/app/api/routes/auth/login.py | brianmask/fast-boiler | 7fc1710d13ba7187445e885735cb54ff6169b566 | [
"Apache-2.0"
] | null | null | null | src/app/api/routes/auth/login.py | brianmask/fast-boiler | 7fc1710d13ba7187445e885735cb54ff6169b566 | [
"Apache-2.0"
] | null | null | null | src/app/api/routes/auth/login.py | brianmask/fast-boiler | 7fc1710d13ba7187445e885735cb54ff6169b566 | [
"Apache-2.0"
] | null | null | null | """ endpoints to hande basic authentication """
import base64
from fastapi import APIRouter, Depends, HTTPException
from fastapi.encoders import jsonable_encoder
from fastapi.security import OAuth2PasswordRequestForm
from starlette.responses import JSONResponse, RedirectResponse, Response
from app import crud
from ... | 31.625 | 85 | 0.733202 |
74082024f827ec9e13a34129816abb18c71ea1d5 | 4,617 | py | Python | gygax/bot/events.py | tmacro/hitman_agent | dab124adbac6e16b9f494246a49624f7af9c28da | [
"BSD-3-Clause"
] | 1 | 2017-07-29T13:02:28.000Z | 2017-07-29T13:02:28.000Z | gygax/bot/events.py | tmacro/hitman_agent | dab124adbac6e16b9f494246a49624f7af9c28da | [
"BSD-3-Clause"
] | null | null | null | gygax/bot/events.py | tmacro/hitman_agent | dab124adbac6e16b9f494246a49624f7af9c28da | [
"BSD-3-Clause"
] | null | null | null | from .dispatch import Event
from .const import EVENT_TYPES as ETYPES
from .const import CMD_TYPES as CTYPES
import re
class MessageEvent(Event):
type = ETYPES.MSG
@property
def text(self):
return self._get('text')
@property
def user(self):
return self._get('user')
@property
def channel(self):
return se... | 19.078512 | 79 | 0.692441 |
740821897aa91d4964e5dd51fe74fcaace8039ac | 2,578 | py | Python | Tools/Scripts/libraries/webkitcorepy/webkitcorepy/__init__.py | jacadcaps/webkitty | 9aebd2081349f9a7b5d168673c6f676a1450a66d | [
"BSD-2-Clause"
] | 6 | 2021-07-05T16:09:39.000Z | 2022-03-06T22:44:42.000Z | Tools/Scripts/libraries/webkitcorepy/webkitcorepy/__init__.py | jacadcaps/webkitty | 9aebd2081349f9a7b5d168673c6f676a1450a66d | [
"BSD-2-Clause"
] | 7 | 2022-03-15T13:25:39.000Z | 2022-03-15T13:25:44.000Z | Tools/Scripts/libraries/webkitcorepy/webkitcorepy/__init__.py | jacadcaps/webkitty | 9aebd2081349f9a7b5d168673c6f676a1450a66d | [
"BSD-2-Clause"
] | null | null | null | # Copyright (C) 2020 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the fo... | 48.641509 | 99 | 0.761055 |
7408239118cd90bf11e9eabafe6e2d16dcaf251e | 6,687 | py | Python | custom_components/hyperion_link/config_flow.py | MichelGerding/Hyperion_link | c4d1f39dd961c8e0a59dce6a51593338564dee84 | [
"MIT"
] | null | null | null | custom_components/hyperion_link/config_flow.py | MichelGerding/Hyperion_link | c4d1f39dd961c8e0a59dce6a51593338564dee84 | [
"MIT"
] | null | null | null | custom_components/hyperion_link/config_flow.py | MichelGerding/Hyperion_link | c4d1f39dd961c8e0a59dce6a51593338564dee84 | [
"MIT"
] | null | null | null | """Config flow for hyperion_link integration."""
from __future__ import annotations
import logging
# from os import link
from typing import Any
from ipaddress import ip_address
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.core import HomeAssistant
from homeassistant.data_entr... | 29.72 | 88 | 0.56408 |
740841243f26fa33669cbc0f7de986c37b36b3b4 | 5,205 | py | Python | experiments/vitchyr/disentanglement/mix_vectorized_and_single_reward/pnp_first_try.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | 1 | 2020-10-23T14:40:09.000Z | 2020-10-23T14:40:09.000Z | experiments/vitchyr/disentanglement/mix_vectorized_and_single_reward/pnp_first_try.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/vitchyr/disentanglement/mix_vectorized_and_single_reward/pnp_first_try.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | 1 | 2021-05-27T20:38:45.000Z | 2021-05-27T20:38:45.000Z | import torch.nn.functional as F
import rlkit.misc.hyperparameter as hyp
from rlkit.launchers.experiments.disentanglement.contextual_encoder_distance_launcher import (
encoder_goal_conditioned_sac_experiment
)
from rlkit.launchers.launcher_util import run_experiment
if __name__ == "__main__":
variant = dict(
... | 29.742857 | 94 | 0.536407 |
7408452dfdbed6f56d0e2243de45d1e90b286cdf | 1,490 | py | Python | simpleclassroom/urls.py | cbetheridge/simpleclassroom | 9e99262ffdb4efc0e27566855866dfc26244bf26 | [
"MIT"
] | null | null | null | simpleclassroom/urls.py | cbetheridge/simpleclassroom | 9e99262ffdb4efc0e27566855866dfc26244bf26 | [
"MIT"
] | null | null | null | simpleclassroom/urls.py | cbetheridge/simpleclassroom | 9e99262ffdb4efc0e27566855866dfc26244bf26 | [
"MIT"
] | null | null | null | """simpleclassroom URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
C... | 42.571429 | 80 | 0.713423 |
74085f95dcc8cee1c4aeef186ea14643e627ac9a | 314 | py | Python | Python3/OTUS/lesson04/lesson04-5.py | neon1ks/Study | 5d40171cf3bf5e8d3a95539e91f5afec54d1daf3 | [
"MIT"
] | null | null | null | Python3/OTUS/lesson04/lesson04-5.py | neon1ks/Study | 5d40171cf3bf5e8d3a95539e91f5afec54d1daf3 | [
"MIT"
] | null | null | null | Python3/OTUS/lesson04/lesson04-5.py | neon1ks/Study | 5d40171cf3bf5e8d3a95539e91f5afec54d1daf3 | [
"MIT"
] | null | null | null | import json
from pprint import pprint
import http.client
HOST = 'httpbin.org'
connection = http.client.HTTPConnection(HOST, port=80)
connection.request('POST', '/post')
response = connection.getresponse()
# body = response.read().decode()
# print(body)
data = json.loads(response.read().decode())
pprint(data)
| 19.625 | 54 | 0.738854 |
74087782556d9a18bfc33095d921d6d111025330 | 220 | py | Python | abc/119/A.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | 2 | 2022-01-22T07:56:58.000Z | 2022-01-24T00:29:37.000Z | abc/119/A.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | abc/119/A.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | yyyy, mm, dd = map(int, input().split("/"))
if 2019 >= yyyy:
if 4 >= mm:
if 30 >= dd:
print("Heisei")
else:
print("TBD")
else:
print("TBD")
else:
print("TBD")
| 16.923077 | 43 | 0.418182 |
740881551472ebe14b54daad658172322d45f31c | 1,137 | py | Python | ml/models/decision_tree.py | refactoring-ai/Machine-Learning | 908d35322a06a7b1709d83f731033a939a864c6b | [
"MIT"
] | 5 | 2020-09-02T19:46:37.000Z | 2021-04-21T15:41:11.000Z | ml/models/decision_tree.py | refactoring-ai/Machine-Learning | 908d35322a06a7b1709d83f731033a939a864c6b | [
"MIT"
] | 16 | 2020-08-04T08:07:50.000Z | 2021-03-23T08:15:30.000Z | ml/models/decision_tree.py | refactoring-ai/Machine-Learning | 908d35322a06a7b1709d83f731033a939a864c6b | [
"MIT"
] | 1 | 2021-04-17T18:34:47.000Z | 2021-04-17T18:34:47.000Z | from configs import SEED
from sklearn.tree import DecisionTreeClassifier
from ml.models.base import SupervisedMLRefactoringModel
class DecisionTreeRefactoringModel(SupervisedMLRefactoringModel):
def feature_reduction(self) -> bool:
return False
def params_to_tune(self):
return {"max_depth": ... | 36.677419 | 67 | 0.617414 |
7408a025d57e30b4e8b189d1ff59acf7b41ed91b | 2,228 | py | Python | tests/common/test_op/ascend/confusion_matrix.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 286 | 2020-06-23T06:40:44.000Z | 2022-03-30T01:27:49.000Z | tests/common/test_op/ascend/confusion_matrix.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 10 | 2020-07-31T03:26:59.000Z | 2021-12-27T15:00:54.000Z | tests/common/test_op/ascend/confusion_matrix.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 30 | 2020-07-17T01:04:14.000Z | 2021-12-27T14:05:19.000Z | # Copyright 2019-2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | 42.846154 | 109 | 0.703321 |
7408b7e8f4f6d9f8c04adc87f3dccbfc67d6e601 | 364 | py | Python | twiliolib/setup.py | averille-cloud-dev/twilio_sms_py | b90045cc99938f6bbd00c194f2d53d418f9e0c66 | [
"MIT"
] | null | null | null | twiliolib/setup.py | averille-cloud-dev/twilio_sms_py | b90045cc99938f6bbd00c194f2d53d418f9e0c66 | [
"MIT"
] | null | null | null | twiliolib/setup.py | averille-cloud-dev/twilio_sms_py | b90045cc99938f6bbd00c194f2d53d418f9e0c66 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
requirements = [
"twilio",
"requests",
"toml",
]
setup(
name="twiliolib",
version="1.0.1",
description="utility library",
author="username",
author_email="averille.cloud.dev@gmail.com",
python_requires=">=3.9,<4.0",
packages=find_pack... | 20.222222 | 48 | 0.656593 |
7408c47469f473fa75f6bad8f21f4d4045b43a38 | 36,408 | py | Python | contrib/python/pytest/_pytest/assertion/rewrite.py | r1nadeg/04_catboost | 6755bbbd1496540b92ded57eea1974f64bef87c5 | [
"Apache-2.0"
] | 15 | 2015-11-21T19:03:19.000Z | 2021-11-30T06:55:23.000Z | contrib/python/pytest/_pytest/assertion/rewrite.py | dsferz/machinelearning_yandex | 8fde8314c5c70299ece8b8f00075ddfcd5e07ddf | [
"Apache-2.0"
] | 13 | 2016-01-31T17:01:39.000Z | 2022-02-19T13:33:21.000Z | contrib/python/pytest/_pytest/assertion/rewrite.py | dsferz/machinelearning_yandex | 8fde8314c5c70299ece8b8f00075ddfcd5e07ddf | [
"Apache-2.0"
] | 9 | 2015-10-22T03:24:14.000Z | 2022-01-09T17:11:03.000Z | """Rewrite assertion AST to produce nice error messages"""
import ast
import _ast
import errno
import itertools
import imp
import marshal
import os
import re
import struct
import sys
import types
from fnmatch import fnmatch
import py
from _pytest.assertion import util
# pytest caches rewritten pycs in __pycache__.
... | 38.445618 | 83 | 0.592727 |
7408d5466a0a29824f6d709a4416148d8f2f9f0a | 868 | py | Python | majority/majority_net.py | iterait/cxflow-examples | e1c8e5a5e0cfe3abe92971748ac7f2c2a3673823 | [
"MIT"
] | null | null | null | majority/majority_net.py | iterait/cxflow-examples | e1c8e5a5e0cfe3abe92971748ac7f2c2a3673823 | [
"MIT"
] | 3 | 2019-09-06T11:37:18.000Z | 2019-09-10T11:01:07.000Z | majority/majority_net.py | iterait/emloop-examples | e1c8e5a5e0cfe3abe92971748ac7f2c2a3673823 | [
"MIT"
] | null | null | null | import logging
import emloop_tensorflow as eltf
import tensorflow as tf
import tensorflow.contrib.keras as K
class MajorityNet(eltf.BaseModel):
"""Simple 2-layered MLP for majority task."""
def _create_model(self, hidden):
logging.debug('Constructing placeholders matching the model.inputs')
... | 34.72 | 87 | 0.673963 |
7408d96fe0d53cacf72a668773157a60f5aaa64d | 8,096 | py | Python | python/pynq/iop/pmod_timer.py | AEW2015/PYNQ_PR_Overlay | 2c685d2d76d04e579beecdbdfd8d0919b3dfa71c | [
"BSD-3-Clause"
] | 16 | 2017-03-14T20:28:40.000Z | 2021-11-02T12:45:15.000Z | python/pynq/iop/pmod_timer.py | xupsh/PYNQ_PR_Overlay | 2c685d2d76d04e579beecdbdfd8d0919b3dfa71c | [
"BSD-3-Clause"
] | 2 | 2017-12-04T05:46:35.000Z | 2018-11-30T21:40:45.000Z | python/pynq/iop/pmod_timer.py | xupsh/PYNQ_PR_Overlay | 2c685d2d76d04e579beecdbdfd8d0919b3dfa71c | [
"BSD-3-Clause"
] | 8 | 2017-03-30T22:00:43.000Z | 2020-09-08T12:49:39.000Z | # Copyright (c) 2016, Xilinx, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of ... | 36.968037 | 79 | 0.583745 |
7408d9cf09fdf31c5f666beafba2f90dfb2ead8b | 1,467 | py | Python | repos/system_upgrade/el7toel8/actors/redhatsignedrpmscanner/actor.py | adka1408/leapp-repository | be5a9603b57f86c65d395ba6a02b860cacae0fb6 | [
"Apache-2.0"
] | null | null | null | repos/system_upgrade/el7toel8/actors/redhatsignedrpmscanner/actor.py | adka1408/leapp-repository | be5a9603b57f86c65d395ba6a02b860cacae0fb6 | [
"Apache-2.0"
] | null | null | null | repos/system_upgrade/el7toel8/actors/redhatsignedrpmscanner/actor.py | adka1408/leapp-repository | be5a9603b57f86c65d395ba6a02b860cacae0fb6 | [
"Apache-2.0"
] | null | null | null | from leapp.actors import Actor
from leapp.models import InstalledRedHatSignedRPM, InstalledUnsignedRPM, InstalledRPM
from leapp.tags import IPUWorkflowTag, FactsPhaseTag
class RedHatSignedRpmScanner(Actor):
"""
Provides data about installed RPM Packages signed by Red Hat.
After filtering the list of inst... | 35.780488 | 104 | 0.64349 |
7408de0522581b4fba8f028ea0e07403258cae7c | 3,710 | py | Python | 6.extract_entities/twitterNLP/twitter_nlp_clone/hbc/python/conll2hbc.py | esh-b/Resources-for-Twitter-related-projects | 28f2b54b47b76fdb5d4804692c13bccfef1805a0 | [
"BSD-3-Clause"
] | 2 | 2019-12-10T21:54:48.000Z | 2020-06-30T20:37:57.000Z | 6.extract_entities/twitterNLP/twitter_nlp_clone/hbc/python/conll2hbc.py | esh-b/Resources-for-Twitter-related-projects | 28f2b54b47b76fdb5d4804692c13bccfef1805a0 | [
"BSD-3-Clause"
] | null | null | null | 6.extract_entities/twitterNLP/twitter_nlp_clone/hbc/python/conll2hbc.py | esh-b/Resources-for-Twitter-related-projects | 28f2b54b47b76fdb5d4804692c13bccfef1805a0 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
####################################################################################
# conll2hbc.py
#
# Converts manually labeled data in CoNLL format (each line contains word+tag)
# into HBC format for LabeledLDA
####################################################################################
i... | 33.125 | 92 | 0.571968 |
7408f55fda3ec8243fc8d0d31c2ddd02747d90b9 | 6,220 | py | Python | nova/virt/hyperv/hostops.py | osrg/nova | 14b6bc655145c832bd9c822e48f877818e0e53ff | [
"Apache-2.0"
] | null | null | null | nova/virt/hyperv/hostops.py | osrg/nova | 14b6bc655145c832bd9c822e48f877818e0e53ff | [
"Apache-2.0"
] | null | null | null | nova/virt/hyperv/hostops.py | osrg/nova | 14b6bc655145c832bd9c822e48f877818e0e53ff | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Cloudbase Solutions Srl
# 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.ap... | 33.989071 | 78 | 0.622186 |
7408fabe9430ae9e3da776cb68e975876766f70e | 978 | py | Python | blitzortung/logger.py | wuan/bo-python | 86c90e437ff456092bf7c9eff8c85daffdd220f0 | [
"Apache-2.0"
] | 3 | 2015-04-09T22:33:59.000Z | 2019-02-12T12:52:16.000Z | blitzortung/logger.py | wuan/bo-python | 86c90e437ff456092bf7c9eff8c85daffdd220f0 | [
"Apache-2.0"
] | 7 | 2015-05-23T13:38:14.000Z | 2019-12-13T20:43:12.000Z | blitzortung/logger.py | wuan/bo-python | 86c90e437ff456092bf7c9eff8c85daffdd220f0 | [
"Apache-2.0"
] | 4 | 2015-12-13T12:40:40.000Z | 2021-07-09T10:48:16.000Z | # -*- coding: utf8 -*-
"""
Copyright 2014-2016 Andreas Würl
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 ap... | 29.636364 | 92 | 0.735174 |
740952bc8a4d49c0fcf56e6cc939c225a4db98f3 | 8,773 | py | Python | cirq/ionq/service.py | Mu-L/Cirq | 680ae219fc53b4ecfdd1c948f5bb5658949ecead | [
"Apache-2.0"
] | null | null | null | cirq/ionq/service.py | Mu-L/Cirq | 680ae219fc53b4ecfdd1c948f5bb5658949ecead | [
"Apache-2.0"
] | null | null | null | cirq/ionq/service.py | Mu-L/Cirq | 680ae219fc53b4ecfdd1c948f5bb5658949ecead | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The Cirq Developers
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | 40.804651 | 100 | 0.64197 |
740964c4d87b6c716def4621d045ce8a9cbaddbf | 4,043 | py | Python | VMEncryption/main/oscrypto/ubuntu_1604/encryptstates/StripdownState.py | jamvar/azure-linux-extensions | 66610daae2ef09f7920d9c4aa2e99a3035fe76a6 | [
"Apache-2.0"
] | null | null | null | VMEncryption/main/oscrypto/ubuntu_1604/encryptstates/StripdownState.py | jamvar/azure-linux-extensions | 66610daae2ef09f7920d9c4aa2e99a3035fe76a6 | [
"Apache-2.0"
] | null | null | null | VMEncryption/main/oscrypto/ubuntu_1604/encryptstates/StripdownState.py | jamvar/azure-linux-extensions | 66610daae2ef09f7920d9c4aa2e99a3035fe76a6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# VM Backup extension
#
# Copyright 2015 Microsoft Corporation
#
# 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
#
# U... | 46.471264 | 141 | 0.675736 |
7409915f94a6bbe22db5d4830854521ce90bc119 | 566 | py | Python | src/utils/population/reduction.py | gbrunow/de | ac11decc80a14485ccef62243e8c06696bd88a17 | [
"MIT"
] | null | null | null | src/utils/population/reduction.py | gbrunow/de | ac11decc80a14485ccef62243e8c06696bd88a17 | [
"MIT"
] | null | null | null | src/utils/population/reduction.py | gbrunow/de | ac11decc80a14485ccef62243e8c06696bd88a17 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import numpy as np
from .common import best
def linear(
population: np.array,
evaluation: np.array,
size: int,
minSize: int,
generation: int,
maxGenerations: int
):
currentSize = population.shape[1]
newSize = round(
size +
(
(minSize ... | 18.258065 | 45 | 0.560071 |
7409c92edca6eca5c1a534606d553f43504a9e5d | 825 | py | Python | python/challenges/quick_sort/quick_sort.py | ManarAbdelkarim/data-structures-and-algorithms | ece37d03c5931d2d6b0ce2d677635fb718944c38 | [
"MIT"
] | null | null | null | python/challenges/quick_sort/quick_sort.py | ManarAbdelkarim/data-structures-and-algorithms | ece37d03c5931d2d6b0ce2d677635fb718944c38 | [
"MIT"
] | 1 | 2021-05-06T19:41:25.000Z | 2021-05-06T19:41:25.000Z | python/challenges/quick_sort/quick_sort.py | ManarAbdelkarim/data-structures-and-algorithms | ece37d03c5931d2d6b0ce2d677635fb718944c38 | [
"MIT"
] | 2 | 2021-06-06T18:02:58.000Z | 2021-08-15T18:56:26.000Z | def quick_sort(myList, i, j):
if i < j:
pivot = partition(myList, i, j)
quick_sort(myList, i, pivot-1)
quick_sort(myList, pivot+1, j)
return myList
def partition(myList, start, end):
pivot = myList[start]
left = start+1
right = end
done = False
while not done:
... | 24.264706 | 54 | 0.561212 |
7409c9f766ff2f908f6e1379e238e47cbc3b6a81 | 10,592 | py | Python | asynctb/_tests/test_frames.py | shamrin/asynctb | d06a77cb2e496108e73adc65e27d1d313592685a | [
"Apache-2.0",
"MIT"
] | 6 | 2020-07-02T16:43:15.000Z | 2021-11-29T06:30:57.000Z | asynctb/_tests/test_frames.py | shamrin/asynctb | d06a77cb2e496108e73adc65e27d1d313592685a | [
"Apache-2.0",
"MIT"
] | 2 | 2020-07-02T09:00:50.000Z | 2020-07-26T06:39:09.000Z | asynctb/_tests/test_frames.py | shamrin/asynctb | d06a77cb2e496108e73adc65e27d1d313592685a | [
"Apache-2.0",
"MIT"
] | 2 | 2020-07-05T01:25:37.000Z | 2021-01-26T08:00:06.000Z | import contextlib
import dis
import sys
import types
import attr
import pytest
from asynctb import _frames
original_inspect_frame = _frames.inspect_frame
@types.coroutine
def async_yield(val):
return (yield val)
class YieldsDuringAexit:
async def __aenter__(self):
return None
async def __ae... | 32.490798 | 88 | 0.565616 |
7409d8e43ab5e1bf26c7e075de713ebfb50fb265 | 19,476 | py | Python | sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2021_12_01_preview/aio/operations/_export_pipelines_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2021_12_01_preview/aio/operations/_export_pipelines_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2021_12_01_preview/aio/operations/_export_pipelines_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 46.817308 | 225 | 0.680376 |
7409dca365ac0f8c58e67ae91e2486d78139e43b | 18,247 | py | Python | ginga/util/io_fits.py | SimonKrughoff/ginga | abcd284228400092b2d7b73bb51d30632e90ee03 | [
"BSD-3-Clause"
] | 1 | 2019-04-27T01:34:27.000Z | 2019-04-27T01:34:27.000Z | ginga/util/io_fits.py | SimonKrughoff/ginga | abcd284228400092b2d7b73bb51d30632e90ee03 | [
"BSD-3-Clause"
] | null | null | null | ginga/util/io_fits.py | SimonKrughoff/ginga | abcd284228400092b2d7b73bb51d30632e90ee03 | [
"BSD-3-Clause"
] | null | null | null | #
# io_fits.py -- Module wrapper for loading FITS files.
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
"""
There are two possible choices for a python FITS file reading package
compatible with Ginga: astropy/pyfits and fitsio. Both are based on
the CFIT... | 31.844677 | 78 | 0.534115 |
740a1ed1e0d6643d273dd03ba1fcb3841d46334e | 9,916 | py | Python | visualization/st_3.py | pollyyu/trends-togo | 9fc192f19599f9aaba1754f80d242cce2d0e38c9 | [
"MIT"
] | 1 | 2020-06-08T22:39:09.000Z | 2020-06-08T22:39:09.000Z | visualization/st_3.py | pollyyu/trends-togo | 9fc192f19599f9aaba1754f80d242cce2d0e38c9 | [
"MIT"
] | null | null | null | visualization/st_3.py | pollyyu/trends-togo | 9fc192f19599f9aaba1754f80d242cce2d0e38c9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import streamlit as st
import pandas as pd
import numpy as np
import pickle
from collections import defaultdict
from sqlalchemy import create_engine
import time
from datetime import timedelta
from sys import getsizeof
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import seaborn... | 38.583658 | 238 | 0.714098 |
740a71a5ce8db8d79fb57f64d731c0d212309818 | 14,286 | py | Python | tests/igniter/test_bootstrap_repos.py | yosuperdope/OpenPype | 0c90df97ddb8cda291a4f66d35da58b3deb94a71 | [
"MIT"
] | 44 | 2019-03-19T04:56:35.000Z | 2021-04-23T12:05:08.000Z | tests/unit/igniter/test_bootstrap_repos.py | jrsndl/pype | f9d80ef2c0663921291c5f47d24bea51fc43bac7 | [
"MIT"
] | 655 | 2020-03-17T15:10:21.000Z | 2021-04-23T18:22:52.000Z | tests/unit/igniter/test_bootstrap_repos.py | jrsndl/pype | f9d80ef2c0663921291c5f47d24bea51fc43bac7 | [
"MIT"
] | 21 | 2019-03-19T04:56:38.000Z | 2021-04-23T09:10:59.000Z | # -*- coding: utf-8 -*-
"""Test suite for repos bootstrapping (install)."""
import os
import sys
from collections import namedtuple
from pathlib import Path
from zipfile import ZipFile
from uuid import uuid4
import appdirs
import pytest
from igniter.bootstrap_repos import BootstrapRepos
from igniter.bootstrap_repos i... | 36.630769 | 79 | 0.597018 |
740a8410f85867a3cd3fc671f54f269638ab2225 | 2,081 | py | Python | render.py | lpassig/azurecompare | dd9936e0e80c8baa1db01cb724402f04bf97f6f9 | [
"MIT"
] | 1 | 2020-11-27T12:56:31.000Z | 2020-11-27T12:56:31.000Z | render.py | lpassig/azurecompare | dd9936e0e80c8baa1db01cb724402f04bf97f6f9 | [
"MIT"
] | null | null | null | render.py | lpassig/azurecompare | dd9936e0e80c8baa1db01cb724402f04bf97f6f9 | [
"MIT"
] | null | null | null | import mako.template
import mako.lookup
import mako.exceptions
import json
import datetime
def json_load_byteified(file_handle):
return _byteify(
json.load(file_handle, object_hook=_byteify),
ignore_dicts=True
)
def json_loads_byteified(json_text):
return _byteify(
js... | 37.836364 | 86 | 0.668909 |
740aaba1c16e653221bf194b7bed980d69e374d1 | 8,576 | py | Python | website/project/views/comment.py | dplorimer/osf | 9f3f400f62dc7bde18532949ed35bf1d3f6ec3d6 | [
"Apache-2.0"
] | null | null | null | website/project/views/comment.py | dplorimer/osf | 9f3f400f62dc7bde18532949ed35bf1d3f6ec3d6 | [
"Apache-2.0"
] | null | null | null | website/project/views/comment.py | dplorimer/osf | 9f3f400f62dc7bde18532949ed35bf1d3f6ec3d6 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import collections
import httplib as http
import pytz
from flask import request
from modularodm import Q
from framework.exceptions import HTTPError
from framework.auth.decorators import must_be_logged_in
from framework.auth.utils import privacy_info_handle
from framework.forms.utils import san... | 27.664516 | 85 | 0.642374 |
740b7632b4bf1b0498a33ee3db660ad45e656913 | 3,930 | py | Python | tests/plugins/fake_controller.py | AlexTalker/integrated-manager-for-lustre | 251099e5c776f3c1898af50bb7cc77924c7cf7c7 | [
"MIT"
] | 1 | 2021-02-08T16:59:14.000Z | 2021-02-08T16:59:14.000Z | tests/plugins/fake_controller.py | AlexTalker/integrated-manager-for-lustre | 251099e5c776f3c1898af50bb7cc77924c7cf7c7 | [
"MIT"
] | null | null | null | tests/plugins/fake_controller.py | AlexTalker/integrated-manager-for-lustre | 251099e5c776f3c1898af50bb7cc77924c7cf7c7 | [
"MIT"
] | null | null | null | from chroma_core.lib.storage_plugin.api.plugin import Plugin
from chroma_core.lib.storage_plugin.api.identifiers import ScopedId, AutoId, GlobalId
from chroma_core.lib.storage_plugin.api import attributes
from chroma_core.lib.storage_plugin.api import statistics
from chroma_core.lib.storage_plugin.api import resources
... | 30.944882 | 118 | 0.624936 |
740b81411dde8aa89e7f8072a9e831df600b982b | 4,613 | py | Python | pypipegraph/mp_queues.py | bopopescu/pypipegraph-2 | 3a3f9ba565789d8d73c8cd503703a957de2be9d8 | [
"MIT"
] | null | null | null | pypipegraph/mp_queues.py | bopopescu/pypipegraph-2 | 3a3f9ba565789d8d73c8cd503703a957de2be9d8 | [
"MIT"
] | null | null | null | pypipegraph/mp_queues.py | bopopescu/pypipegraph-2 | 3a3f9ba565789d8d73c8cd503703a957de2be9d8 | [
"MIT"
] | null | null | null | """Fix Queue for running a pypipegraph within an import"""
import threading
from multiprocessing.util import is_exiting, debug, Finalize
import multiprocessing.queues
Queue = multiprocessing.queues.Queue
import weakref
import traceback
_sentinel = multiprocessing.queues._sentinel
import sys
import os
import pickle
... | 35.75969 | 92 | 0.424019 |
740b89a53100e3aa56c5199707e8493a9a0a7658 | 7,815 | py | Python | tests/test_rhizome.py | umr-ds/pyserval | 073363ee56754f122d5b09544f242d54a17165e3 | [
"MIT"
] | 1 | 2017-08-29T19:37:31.000Z | 2017-08-29T19:37:31.000Z | tests/test_rhizome.py | umr-ds/pyserval | 073363ee56754f122d5b09544f242d54a17165e3 | [
"MIT"
] | 16 | 2017-11-29T16:41:35.000Z | 2019-09-30T13:44:10.000Z | tests/test_rhizome.py | umr-ds/pyserval | 073363ee56754f122d5b09544f242d54a17165e3 | [
"MIT"
] | 1 | 2017-08-20T21:51:52.000Z | 2017-08-20T21:51:52.000Z | """Tests for pyserval.rhizome"""
from pyserval.client import Client
from pyserval.exceptions import DuplicateBundleException
from hypothesis import given
from tests.custom_strategies import (
unicode_printable,
ascii_alphanum,
payloads,
payloads_nonempty,
custom_fields,
)
# if we try to create ... | 34.126638 | 114 | 0.705182 |
740b8f7d4d3d08389a53b08c4fcdf84e084c4dea | 6,004 | py | Python | asposeimagingcloud/models/requests/create_modified_jpeg_request.py | aspose-imaging-cloud/aspose-imaging-cloud-python | 9280a4a1aa415cb569ec26a05792b33186d31a85 | [
"MIT"
] | 1 | 2022-01-14T10:06:26.000Z | 2022-01-14T10:06:26.000Z | asposeimagingcloud/models/requests/create_modified_jpeg_request.py | aspose-imaging-cloud/aspose-imaging-cloud-python | 9280a4a1aa415cb569ec26a05792b33186d31a85 | [
"MIT"
] | 3 | 2019-07-17T15:01:31.000Z | 2020-12-29T09:16:10.000Z | asposeimagingcloud/models/requests/create_modified_jpeg_request.py | aspose-imaging-cloud/aspose-imaging-cloud-python | 9280a4a1aa415cb569ec26a05792b33186d31a85 | [
"MIT"
] | null | null | null | # coding: utf-8
# ----------------------------------------------------------------------------
# <copyright company="Aspose" file="create_modified_jpeg_request.py">
# Copyright (c) 2018-2020 Aspose Pty Ltd. All rights reserved.
# </copyright>
# <summary>
# Permission is hereby granted, free of charge, to any... | 50.453782 | 252 | 0.672718 |
740b959f27ba689b716920aed5875e420e2b975f | 6,065 | py | Python | rj_gameplay/rj_gameplay/role/goalie_role.py | p-nayak11/robocup-software | 542292e5cbb317234620d241b9c476ab125ebdf3 | [
"Apache-2.0"
] | null | null | null | rj_gameplay/rj_gameplay/role/goalie_role.py | p-nayak11/robocup-software | 542292e5cbb317234620d241b9c476ab125ebdf3 | [
"Apache-2.0"
] | null | null | null | rj_gameplay/rj_gameplay/role/goalie_role.py | p-nayak11/robocup-software | 542292e5cbb317234620d241b9c476ab125ebdf3 | [
"Apache-2.0"
] | null | null | null | import stp
from rj_gameplay.skill import move, receive, pivot_kick # , line_kick, intercept
import numpy as np
# TODO: settle on unified way to define constants in gameplay
from stp.utils.constants import RobotConstants # , BallConstants
# import stp.global_parameters as global_parameters
# from stp.local_paramete... | 36.981707 | 171 | 0.619456 |
740ba0f93722d50f2e8c5c3f3e01d6a3524614bf | 5,881 | py | Python | pex/vendor/_vendored/setuptools/setuptools/installer.py | tdyas/pex | e2d6bab09f8e9245f608402a904421268223ee58 | [
"Apache-2.0"
] | 2,160 | 2015-01-06T17:57:39.000Z | 2022-03-30T19:59:01.000Z | pex/vendor/_vendored/setuptools/setuptools/installer.py | tdyas/pex | e2d6bab09f8e9245f608402a904421268223ee58 | [
"Apache-2.0"
] | 1,242 | 2015-01-22T14:56:46.000Z | 2022-03-31T18:02:38.000Z | pex/vendor/_vendored/setuptools/setuptools/installer.py | tdyas/pex | e2d6bab09f8e9245f608402a904421268223ee58 | [
"Apache-2.0"
] | 248 | 2015-01-15T13:34:50.000Z | 2022-03-26T01:24:18.000Z | import glob
import os
import subprocess
import sys
from distutils import log
from distutils.errors import DistutilsError
if "__PEX_UNVENDORED__" in __import__("os").environ:
import pkg_resources # vendor:skip
else:
import pex.third_party.pkg_resources as pkg_resources
if "__PEX_UNVENDORED__" in __import__("os").... | 35.215569 | 79 | 0.655501 |
740bb3ed77314c5f052c14b117271f1fd49f68ef | 23,298 | py | Python | datawinners/entity/import_data.py | ICT4H/dcs-web | fb0f53fad4401cfac1c1789ff28b9d5bda40c975 | [
"Apache-2.0"
] | 1 | 2015-11-02T09:11:12.000Z | 2015-11-02T09:11:12.000Z | datawinners/entity/import_data.py | ICT4H/dcs-web | fb0f53fad4401cfac1c1789ff28b9d5bda40c975 | [
"Apache-2.0"
] | null | null | null | datawinners/entity/import_data.py | ICT4H/dcs-web | fb0f53fad4401cfac1c1789ff28b9d5bda40c975 | [
"Apache-2.0"
] | null | null | null | # vim: ai ts=4 sts=4 et sw=4 encoding=utf-8
import os
import logging
import re
from django.conf import settings
from django.core.exceptions import ValidationError
from django.db.utils import IntegrityError
from django.utils.translation import ugettext as _, ugettext_lazy, ugettext
from django.contrib.auth.models impor... | 45.952663 | 174 | 0.683406 |
740bb4931df8e9245076f69ead8afe97f880225f | 1,384 | py | Python | sprint-challenge/aq_dashboard.py | joshdsolis/DS-Unit-3-Sprint-4-Productization-and-Cloud | 077995b1b9cdde946862895582d0e9a667527dd3 | [
"MIT"
] | null | null | null | sprint-challenge/aq_dashboard.py | joshdsolis/DS-Unit-3-Sprint-4-Productization-and-Cloud | 077995b1b9cdde946862895582d0e9a667527dd3 | [
"MIT"
] | null | null | null | sprint-challenge/aq_dashboard.py | joshdsolis/DS-Unit-3-Sprint-4-Productization-and-Cloud | 077995b1b9cdde946862895582d0e9a667527dd3 | [
"MIT"
] | null | null | null | """OpenAQ Air Quality Dashboard with Flask."""
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
import openaq
APP = Flask(__name__)
api = openaq.OpenAQ()
status, body = api.measurements(city='Los Angeles', parameter='pm25')
l = []
for x in range(len(body['results'])):
l.append((body['results'][x]['d... | 30.755556 | 78 | 0.650289 |
740bfeae74e8ec1a19b737cc37608338a2ad4633 | 4,363 | py | Python | forte/processors/machine_translation_processor.py | swapnull7/forte | 737a72afd440d40c3826c3a7c5e4e44235c0f701 | [
"Apache-2.0"
] | 2 | 2021-01-01T12:07:27.000Z | 2021-09-10T03:57:18.000Z | forte/processors/machine_translation_processor.py | swapnull7/forte | 737a72afd440d40c3826c3a7c5e4e44235c0f701 | [
"Apache-2.0"
] | null | null | null | forte/processors/machine_translation_processor.py | swapnull7/forte | 737a72afd440d40c3826c3a7c5e4e44235c0f701 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The Forte Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 37.93913 | 80 | 0.659179 |
740bffe67c0f22f4b96e55659d69130473ccde02 | 3,192 | py | Python | ParsersClasses/MicroParser.py | UFRGS-CAROL/radiation-benchmarks-parsers | a39844ed3ed511f4f2672bc2e0c7e6f920dc7f2b | [
"Apache-2.0"
] | null | null | null | ParsersClasses/MicroParser.py | UFRGS-CAROL/radiation-benchmarks-parsers | a39844ed3ed511f4f2672bc2e0c7e6f920dc7f2b | [
"Apache-2.0"
] | null | null | null | ParsersClasses/MicroParser.py | UFRGS-CAROL/radiation-benchmarks-parsers | a39844ed3ed511f4f2672bc2e0c7e6f920dc7f2b | [
"Apache-2.0"
] | null | null | null | import re
from ParsersClasses import Parser
class MicroParser(Parser.Parser):
_csvHeader = ['logFileName', 'Machine', 'Benchmark', 'Header',
'SDC', 'LOGGED_ERRORS', 'ACC_ERR', 'corrupted_elements', 'detected_elements', 'max_relative_error']
_corrupted_elements = 0
_detected_elements = 0
... | 36.689655 | 117 | 0.56015 |
740c0316ec5046d3160b1bb2c639f67caaab91b2 | 745 | py | Python | tests/test_write_csv.py | p-enel/tensorboard-reducer | d8258cd25cc9d809b4e733cbc6ba4f9f245dc8a2 | [
"MIT"
] | null | null | null | tests/test_write_csv.py | p-enel/tensorboard-reducer | d8258cd25cc9d809b4e733cbc6ba4f9f245dc8a2 | [
"MIT"
] | null | null | null | tests/test_write_csv.py | p-enel/tensorboard-reducer | d8258cd25cc9d809b4e733cbc6ba4f9f245dc8a2 | [
"MIT"
] | null | null | null | # %%
import os
import pandas as pd
from tensorboard_reducer import reduce_events, write_csv
reduce_ops = ["mean", "std", "median"]
def test_write_csv(events_dict):
if os.path.exists("tmp/strict.csv"):
os.remove("tmp/strict.csv")
reduced_events = reduce_events(events_dict, reduce_ops)
write_c... | 23.28125 | 72 | 0.673826 |
740c2bd0d781eefbf552909405c99a14b3098b88 | 12,073 | py | Python | src/uvm/base/cmdline_processor.py | fvutils/uvm-py | 5e5ed203b680ead6e1b47fcff6d74fa99b5929c4 | [
"Apache-2.0"
] | 1 | 2019-10-13T06:14:28.000Z | 2019-10-13T06:14:28.000Z | src/uvm/base/cmdline_processor.py | fvutils/uvm-py | 5e5ed203b680ead6e1b47fcff6d74fa99b5929c4 | [
"Apache-2.0"
] | null | null | null | src/uvm/base/cmdline_processor.py | fvutils/uvm-py | 5e5ed203b680ead6e1b47fcff6d74fa99b5929c4 | [
"Apache-2.0"
] | 1 | 2019-12-23T06:21:49.000Z | 2019-12-23T06:21:49.000Z | #
#------------------------------------------------------------------------------
# Copyright 2010-2018 Cadence Design Systems, Inc.
# Copyright 2010-2018 AMD
# Copyright 2010-2018 Mentor Graphics Corporation
# Copyright 2013-2018 NVIDIA Corporation
# Copyright 2017 Cisco Systems, Inc.
# Copyright 2015 Analog Devices, ... | 36.364458 | 142 | 0.630001 |
740c3236bb65f73a370e8118001f7d91be5f5614 | 2,652 | py | Python | venv/Lib/site-packages/pyrogram/raw/functions/auth/export_login_token.py | D1ne2021/jjhhhjj | a090da30983b3ef276dfe4cef2ded4526f36002a | [
"MIT"
] | 2 | 2021-12-13T07:09:55.000Z | 2022-01-12T12:15:20.000Z | venv/Lib/site-packages/pyrogram/raw/functions/auth/export_login_token.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pyrogram/raw/functions/auth/export_login_token.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | # Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2021 Dan <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free... | 31.571429 | 103 | 0.613876 |
740c3707509ae05c97c5cb3d6c8ea3e4d2d52afd | 304 | py | Python | pysces/kraken/controllers/kill_tentacles.py | bgoli/pysces | 94e4734824e8f0eb9cfa9489e853afd4c9a37d23 | [
"BSD-3-Clause"
] | 21 | 2015-02-11T22:59:18.000Z | 2022-03-01T15:36:41.000Z | pysces/kraken/controllers/kill_tentacles.py | bgoli/pysces | 94e4734824e8f0eb9cfa9489e853afd4c9a37d23 | [
"BSD-3-Clause"
] | 63 | 2015-03-26T11:58:58.000Z | 2022-02-25T18:44:15.000Z | pysces/kraken/controllers/kill_tentacles.py | bgoli/pysces | 94e4734824e8f0eb9cfa9489e853afd4c9a37d23 | [
"BSD-3-Clause"
] | 9 | 2015-05-01T09:28:56.000Z | 2020-02-25T14:38:14.000Z | import os
import scipy
try:
input = raw_input # Py2 compatibility
except NameError:
pass
from Kraken import time, KrakenController, getBasicController, BLOCK_SIZE
blob = getBasicController()
kin = input('\nKill all idle tentacles? (y/n):\n')
if kin in ['y', 'yes']:
blob.killTentacles()
| 19 | 73 | 0.713816 |
740c3b38e0cdcbb47c5a2979d090ccbc6aae7e07 | 1,030 | py | Python | alipay/aop/api/response/AntMerchantExpandScodeApplyResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/response/AntMerchantExpandScodeApplyResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/response/AntMerchantExpandScodeApplyResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
from alipay.aop.api.domain.ApplyCodeResponse import ApplyCodeResponse
class AntMerchantExpandScodeApplyResponse(AlipayResponse):
def __init__(self):
super(AntMerchantExpandScodeApp... | 34.333333 | 108 | 0.746602 |
740c4dba04622b7923fe42e27195721e592c4b36 | 2,982 | py | Python | doctr/datasets/doc_artefacts.py | Mindee/doctr | b9d8feb1b4a2206e4944ef2dea109acc19585074 | [
"Apache-2.0"
] | 628 | 2021-02-13T21:49:37.000Z | 2022-03-31T19:48:57.000Z | doctr/datasets/doc_artefacts.py | Mindee/doctr | b9d8feb1b4a2206e4944ef2dea109acc19585074 | [
"Apache-2.0"
] | 694 | 2021-02-08T15:23:38.000Z | 2022-03-31T07:24:59.000Z | doctr/datasets/doc_artefacts.py | Mindee/doctr | b9d8feb1b4a2206e4944ef2dea109acc19585074 | [
"Apache-2.0"
] | 90 | 2021-04-28T05:39:02.000Z | 2022-03-31T06:48:36.000Z | # Copyright (C) 2021, Mindee.
# This program is licensed under the Apache License version 2.
# See LICENSE or go to <https://www.apache.org/licenses/LICENSE-2.0.txt> for full license details.
import json
import os
from typing import Any, Dict, List, Tuple
import numpy as np
from .datasets import VisionDataset
__al... | 38.230769 | 110 | 0.601274 |
740c567b10acfdda2c02d85076c81c00aba3a52a | 860 | py | Python | src/testcases/html_runner_tests.py | Jorge644/python-fravega-test | bbfa170fd38bb1ea8c18baccf456ec0f7ca17bc4 | [
"bzip2-1.0.6"
] | null | null | null | src/testcases/html_runner_tests.py | Jorge644/python-fravega-test | bbfa170fd38bb1ea8c18baccf456ec0f7ca17bc4 | [
"bzip2-1.0.6"
] | null | null | null | src/testcases/html_runner_tests.py | Jorge644/python-fravega-test | bbfa170fd38bb1ea8c18baccf456ec0f7ca17bc4 | [
"bzip2-1.0.6"
] | null | null | null | from src.testcases.test_rest_api import RestBreweries
from src.testcases.test_fravega_home import search_heladera
import HtmlTestRunner
import os
import unittest
if __name__ == '__main__':
current_directory = os.getcwd()
consolidate_test = unittest.TestSuite()
#ADD the test cases
consolidate_test.add... | 27.741935 | 75 | 0.693023 |
740c5d30e443fc135a16faca637eb552fb874578 | 27,744 | py | Python | src/semantic_rules.py | ezielramos/cool-compiler-2021 | e5b2aa51e47296b21f8b1ea14d73b1c7e7ef0785 | [
"MIT"
] | null | null | null | src/semantic_rules.py | ezielramos/cool-compiler-2021 | e5b2aa51e47296b21f8b1ea14d73b1c7e7ef0785 | [
"MIT"
] | null | null | null | src/semantic_rules.py | ezielramos/cool-compiler-2021 | e5b2aa51e47296b21f8b1ea14d73b1c7e7ef0785 | [
"MIT"
] | null | null | null | import visitor as visitor
from AST import *
import tools
class Semantic:
def __init__(self):
self.error = []
#classes
self.classmethods = {}
self.classmethods['Object'] = {
'abort': ([],'Object'),
'type_name':([],'String'),
'copy': ([],'SEL... | 40.980798 | 253 | 0.57717 |
740c6833828e805b0572a611f4d83978daf20477 | 6,336 | py | Python | src/ggrc/cache/cachemanager.py | Killswitchz/ggrc-core | 2460df94daf66727af248ad821462692917c97a9 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2018-03-30T11:28:48.000Z | 2018-03-30T11:28:48.000Z | src/ggrc/cache/cachemanager.py | trevordonnelly/ggrc-core | 499cf0d3cce70737b080991b12c203ec22015cea | [
"ECL-2.0",
"Apache-2.0"
] | 10 | 2018-07-06T00:04:23.000Z | 2021-02-26T21:13:20.000Z | src/ggrc/cache/cachemanager.py | zidarsk8/ggrc-core | 2509c989eddf434249d3bef50c21e08dbf56c1a4 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2017-11-11T22:16:56.000Z | 2017-11-11T22:16:56.000Z | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""
CacheManager provides encapsulation to the caching mechanism used in GGRC
for resource collection.
"""
from cache import all_cache_entries, all_mapping_entries
class CacheManager:
"""Cache ... | 30.907317 | 79 | 0.679924 |
740c7e6d0b6f6878606b5e8cb69f7166a48a5f92 | 6,416 | py | Python | src/prechecks/prm.py | rgaensler/gcode | c6a6b617a04490dedefb2bae7b596a2e12ab4ab1 | [
"MIT"
] | null | null | null | src/prechecks/prm.py | rgaensler/gcode | c6a6b617a04490dedefb2bae7b596a2e12ab4ab1 | [
"MIT"
] | 314 | 2020-02-26T12:37:17.000Z | 2021-08-02T00:32:32.000Z | src/prechecks/prm.py | rgaensler/gcode | c6a6b617a04490dedefb2bae7b596a2e12ab4ab1 | [
"MIT"
] | 2 | 2020-11-12T16:07:48.000Z | 2020-11-16T09:14:48.000Z | import time
from random import uniform
from typing import List, Optional, Iterator, Tuple
import numpy as np
from dijkstar import Graph, NoPathError, find_path
from dijkstar.algorithm import PathInfo
from src.kinematics.forward_kinematics import forward_kinematics
from src.kinematics.joints import BaseJoint
from src.... | 39.121951 | 117 | 0.673784 |
740c8a371a6d2e9b307282407a5fa71b0981ef6d | 7,827 | py | Python | catkin_ws/devel/lib/python3/dist-packages/fundamentals/srv/_TimePast.py | a-yildiz/ROS-Simple-Sample-Packages | eb6b18adcd1fe26e2b5e644c42922e8102867cd9 | [
"MIT"
] | 1 | 2021-09-19T07:51:23.000Z | 2021-09-19T07:51:23.000Z | catkin_ws/install/lib/python3/dist-packages/fundamentals/srv/_TimePast.py | a-yildiz/ROS-Simple-Sample-Packages | eb6b18adcd1fe26e2b5e644c42922e8102867cd9 | [
"MIT"
] | null | null | null | catkin_ws/install/lib/python3/dist-packages/fundamentals/srv/_TimePast.py | a-yildiz/ROS-Simple-Sample-Packages | eb6b18adcd1fe26e2b5e644c42922e8102867cd9 | [
"MIT"
] | null | null | null | # This Python file uses the following encoding: utf-8
"""autogenerated by genpy from fundamentals/TimePastRequest.msg. Do not edit."""
import codecs
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
class TimePastRequest(genpy.Message):
_md5sum = "99cf60967b85886d96696de... | 33.025316 | 145 | 0.672288 |
740c956c56351ac4ac4090c2bb0504bc17fd0fc8 | 1,014 | py | Python | apps/contrib/sites/migrations/0003_set_site_domain_and_name.py | ecds/readux | 4eac8b48efef8126f4f2be28b5eb943c85a89c2e | [
"Apache-2.0"
] | 18 | 2017-06-12T09:58:02.000Z | 2021-10-01T11:14:34.000Z | apps/contrib/sites/migrations/0003_set_site_domain_and_name.py | ecds/readux | 4eac8b48efef8126f4f2be28b5eb943c85a89c2e | [
"Apache-2.0"
] | 276 | 2019-04-26T20:13:01.000Z | 2022-03-31T10:26:28.000Z | apps/contrib/sites/migrations/0003_set_site_domain_and_name.py | ecds/readux | 4eac8b48efef8126f4f2be28b5eb943c85a89c2e | [
"Apache-2.0"
] | 7 | 2018-03-13T23:44:26.000Z | 2021-09-15T17:54:55.000Z | """
To understand why this file is here, please read:
http://cookiecutter-django.readthedocs.io/en/latest/faq.html#why-is-there-a-django-contrib-sites-directory-in-cookiecutter-django
"""
from django.conf import settings
from django.db import migrations
def update_site_forward(apps, schema_editor):
"""Set site d... | 28.971429 | 129 | 0.686391 |
740cc62c0889a8d77ef7c72c7e60bb880a55f608 | 7,734 | py | Python | tests/test_generate.py | acutesoftware/rawdata | 9218077a7086fe8a78a4dc508c80a9fae772de13 | [
"MIT"
] | 10 | 2015-06-04T13:05:56.000Z | 2020-01-22T23:58:10.000Z | tests/test_generate.py | acutesoftware/rawdata | 9218077a7086fe8a78a4dc508c80a9fae772de13 | [
"MIT"
] | 5 | 2015-06-17T03:57:12.000Z | 2016-06-09T13:37:35.000Z | tests/test_generate.py | acutesoftware/rawdata | 9218077a7086fe8a78a4dc508c80a9fae772de13 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# test_generate.py
import unittest
import os
import sys
root_fldr = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) + os.sep + 'rawdata'
test_fldr = os.path.dirname(__file__) + os.sep + 'test_results'
sys.path.insert(1, root_fldr)
import random
import generate as generate
class Tes... | 41.358289 | 115 | 0.604991 |
740cc9d5922776b74ceb7ca298239cf6e5bea41d | 10,803 | py | Python | adafruit_circuitpython_libs/adafruit-circuitpython-bundle-py-20210214/lib/adafruit_drv2605.py | jacoblb64/pico_rgb_keypad_hid | 3251ca6a98ef86d9f98c54f639c4d61810601a0b | [
"MIT"
] | 47 | 2021-02-15T23:02:36.000Z | 2022-03-04T21:30:03.000Z | adafruit_circuitpython_libs/adafruit-circuitpython-bundle-py-20210214/lib/adafruit_drv2605.py | jacoblb64/pico_rgb_keypad_hid | 3251ca6a98ef86d9f98c54f639c4d61810601a0b | [
"MIT"
] | 7 | 2021-02-19T20:00:08.000Z | 2022-01-14T10:51:12.000Z | adafruit_circuitpython_libs/adafruit-circuitpython-bundle-py-20210214/lib/adafruit_drv2605.py | jacoblb64/pico_rgb_keypad_hid | 3251ca6a98ef86d9f98c54f639c4d61810601a0b | [
"MIT"
] | 14 | 2021-02-20T17:40:56.000Z | 2022-01-01T19:53:38.000Z | # SPDX-FileCopyrightText: 2017 Tony DiCola for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""
`adafruit_drv2605`
====================================================
CircuitPython module for the DRV2605 haptic feedback motor driver. See
examples/simpletest.py for a demo of the usage.
* Author(s): Tony DiC... | 34.514377 | 84 | 0.662223 |
740cead80e56272725d3ad9e2ed1b1650939fecc | 2,924 | py | Python | leetcode_python/Two_Pointers/trapping-rain-water.py | yennanliu/CS_basics | 3c50c819897a572ff38179bfb0083a19b2325fde | [
"Unlicense"
] | 18 | 2019-08-01T07:45:02.000Z | 2022-03-31T18:05:44.000Z | leetcode_python/Two_Pointers/trapping-rain-water.py | yennanliu/CS_basics | 3c50c819897a572ff38179bfb0083a19b2325fde | [
"Unlicense"
] | null | null | null | leetcode_python/Two_Pointers/trapping-rain-water.py | yennanliu/CS_basics | 3c50c819897a572ff38179bfb0083a19b2325fde | [
"Unlicense"
] | 15 | 2019-12-29T08:46:20.000Z | 2022-03-08T14:14:05.000Z | # V0
# V1
# https://blog.csdn.net/XX_123_1_RJ/article/details/81048041
# IDEA : TWO POINTERS
class Solution:
def trap(self, height):
if not height: return 0
left_max = right_max = res = 0
left, right = 0, len(height) - 1
while left < right:
if height[left] < height[... | 32.853933 | 112 | 0.53249 |
740d0f53618e4b022f216410a34f7dcf61bb7d23 | 746 | py | Python | test/tutorial/scripts/api/put_delete_get_sub_api.py | mshadbolt/dcp-cli | 4d844f3c3a299162c68e25e9ffc6ffe7e8bf7ce8 | [
"MIT"
] | null | null | null | test/tutorial/scripts/api/put_delete_get_sub_api.py | mshadbolt/dcp-cli | 4d844f3c3a299162c68e25e9ffc6ffe7e8bf7ce8 | [
"MIT"
] | null | null | null | test/tutorial/scripts/api/put_delete_get_sub_api.py | mshadbolt/dcp-cli | 4d844f3c3a299162c68e25e9ffc6ffe7e8bf7ce8 | [
"MIT"
] | null | null | null | from hca import HCAConfig
from hca.dss import DSSClient
hca_config = HCAConfig()
hca_config["DSSClient"].swagger_url = f"https://dss.dev.data.humancellatlas.org/v1/swagger.json"
dss = DSSClient(config=hca_config)
# Creates a sub based given a replica and a url
subscription = dss.put_subscription(
replica="aws", c... | 26.642857 | 96 | 0.738606 |
740d5ba7154292dcb9cb9eefd5ca220a99af721f | 7,818 | py | Python | plugins/aea-ledger-ethereum/tests/conftest.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | 28 | 2021-10-31T18:54:14.000Z | 2022-03-17T13:10:43.000Z | plugins/aea-ledger-ethereum/tests/conftest.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | 66 | 2021-10-31T11:55:48.000Z | 2022-03-31T06:26:23.000Z | plugins/aea-ledger-ethereum/tests/conftest.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2021 Valory AG
# Copyright 2018-2020 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# ... | 30.302326 | 111 | 0.659248 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.