hexsha stringlengths 40 40 | size int64 1 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 239 | max_stars_repo_name stringlengths 5 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 239 | max_issues_repo_name stringlengths 5 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 239 | max_forks_repo_name stringlengths 5 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.03M | avg_line_length float64 1 958k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
79841aaa20479b1c2e85b329b81a48487d7ea3bb | 2,086 | py | Python | Lib/test/test_weakref_jy.py | jeff5/jython-whinchat | 65d8e5268189f8197295ff2d91be3decb1ee0081 | [
"CNRI-Jython"
] | 577 | 2020-06-04T16:34:44.000Z | 2022-03-31T11:46:07.000Z | Lib/test/test_weakref_jy.py | jeff5/jython-whinchat | 65d8e5268189f8197295ff2d91be3decb1ee0081 | [
"CNRI-Jython"
] | 174 | 2015-01-08T20:37:09.000Z | 2020-06-03T16:48:59.000Z | Lib/test/test_weakref_jy.py | jeff5/jython-whinchat | 65d8e5268189f8197295ff2d91be3decb1ee0081 | [
"CNRI-Jython"
] | 162 | 2015-02-07T02:14:38.000Z | 2020-05-30T16:42:03.000Z | """Misc weakref tests
Made for Jython.
"""
import unittest
import weakref
from test import test_support
from test_weakref import extra_collect
class ReferencesTestCase(unittest.TestCase):
def test___eq__(self):
class Foo(object):
def __eq__(self, other):
return True
... | 24.541176 | 78 | 0.595877 |
79841af42380a92cbd4f9d5839d4ceafe7558c65 | 25,901 | py | Python | LowLevelApi/NGPF/Python/Link Aggregation/LACP_sample_script.py | NickKeating/IxNetwork | 0a54c0b8d1a1664d2826ad20a826ef384c48432f | [
"MIT"
] | 46 | 2018-01-24T06:43:45.000Z | 2022-03-17T07:27:08.000Z | LowLevelApi/NGPF/Python/Link Aggregation/LACP_sample_script.py | NickKeating/IxNetwork | 0a54c0b8d1a1664d2826ad20a826ef384c48432f | [
"MIT"
] | 104 | 2018-03-16T18:16:29.000Z | 2022-03-17T07:16:43.000Z | LowLevelApi/NGPF/Python/Link Aggregation/LACP_sample_script.py | NickKeating/IxNetwork | 0a54c0b8d1a1664d2826ad20a826ef384c48432f | [
"MIT"
] | 58 | 2018-01-23T05:54:20.000Z | 2022-03-30T22:55:20.000Z | # -*- coding: cp1252 -*-
################################################################################
# Version 1.0 $Revision: 1 $ #
# #
# Copyright © 1997 - 2015 by IXIA ... | 47.612132 | 135 | 0.519787 |
79841c83a2f4a0a11896fe17c8826f7a4b6753dd | 3,602 | py | Python | AppEase_Cloud/AppEaseIoT.py | ericazhang2046/Appease_Summer2021 | 3ea6a0175542c6f05b8389cc69e0e7ef2559a01b | [
"MIT"
] | null | null | null | AppEase_Cloud/AppEaseIoT.py | ericazhang2046/Appease_Summer2021 | 3ea6a0175542c6f05b8389cc69e0e7ef2559a01b | [
"MIT"
] | null | null | null | AppEase_Cloud/AppEaseIoT.py | ericazhang2046/Appease_Summer2021 | 3ea6a0175542c6f05b8389cc69e0e7ef2559a01b | [
"MIT"
] | null | null | null |
# coding: utf-8
# # AppEase IoT data upload to Azure Storage Blobs using MQTT Protocol
#
# - This notebook requires an Azure IoT Hub that has been associated with
# an Azure Storage Account Container and contains a device
# (follow this tutorial to associate them: https://docs.microsoft.com/en-us/azure/iot-hub/iot-h... | 43.926829 | 124 | 0.667962 |
79841d101fad5d9a8375aaa604e1de391ca37de5 | 2,635 | py | Python | hw2_code/select_frames.py | YiY-Xu/11775-hws | fdbdefb8c90d600f9336e3a7491c1f68798cccd4 | [
"Apache-2.0"
] | null | null | null | hw2_code/select_frames.py | YiY-Xu/11775-hws | fdbdefb8c90d600f9336e3a7491c1f68798cccd4 | [
"Apache-2.0"
] | null | null | null | hw2_code/select_frames.py | YiY-Xu/11775-hws | fdbdefb8c90d600f9336e3a7491c1f68798cccd4 | [
"Apache-2.0"
] | null | null | null | #!/bin/python
# Randomly select
import yaml
import numpy as np
import os
import sys
if __name__ == '__main__':
if len(sys.argv) != 4:
print ("Usage: {0} file_list select_ratio output_file".format(sys.argv[0]))
print ("file_list -- the list of video names")
print("config_file -- yaml filepa... | 30.639535 | 105 | 0.549905 |
79841e17dd5325694b87d86a60dd5b39c6a1bf5c | 102,360 | py | Python | electrum_grs/lnpeer.py | Groestlcoin/electrum-grs | 80f00b8d3511bf40be71fc8c0ffe179ab1d57dd5 | [
"MIT"
] | 9 | 2016-09-15T10:10:36.000Z | 2019-08-01T09:08:30.000Z | electrum_grs/lnpeer.py | Groestlcoin/electrum-grs | 80f00b8d3511bf40be71fc8c0ffe179ab1d57dd5 | [
"MIT"
] | 5 | 2017-10-28T08:46:00.000Z | 2019-03-15T00:59:01.000Z | electrum_grs/lnpeer.py | Groestlcoin/electrum-grs | 80f00b8d3511bf40be71fc8c0ffe179ab1d57dd5 | [
"MIT"
] | 5 | 2017-08-24T03:44:27.000Z | 2019-03-03T20:42:25.000Z | #!/usr/bin/env python3
#
# Copyright (C) 2018 The Electrum developers
# Distributed under the MIT software license, see the accompanying
# file LICENCE or http://www.opensource.org/licenses/mit-license.php
import zlib
from collections import OrderedDict, defaultdict
import asyncio
import os
import time
from typing imp... | 50.976096 | 159 | 0.65382 |
79841e37cc2ad71a79233153786ceddbeb8205f3 | 1,767 | py | Python | community/views/community_view.py | ThePokerFaCcCe/messenger | 2db3d5c2ccd05ac40d2442a13d664ca9ad3cb14c | [
"MIT"
] | null | null | null | community/views/community_view.py | ThePokerFaCcCe/messenger | 2db3d5c2ccd05ac40d2442a13d664ca9ad3cb14c | [
"MIT"
] | null | null | null | community/views/community_view.py | ThePokerFaCcCe/messenger | 2db3d5c2ccd05ac40d2442a13d664ca9ad3cb14c | [
"MIT"
] | null | null | null | from django.db.models import Count
from rest_framework import viewsets, mixins, permissions
from community.permissions import IsCommunityAdminMember, IsCommunityNormalMember
from community.models import CommunityChat
from community.serializers import (CommunityChatSerializer,
Communi... | 37.595745 | 81 | 0.647425 |
79841e817e118d75ed217859e8991d168324d0b2 | 2,013 | py | Python | openpyxl/reader/drawings.py | dangqhuy/openpyxl | 42e929b69b0938b081a62fed529ce470054249fb | [
"MIT"
] | null | null | null | openpyxl/reader/drawings.py | dangqhuy/openpyxl | 42e929b69b0938b081a62fed529ce470054249fb | [
"MIT"
] | null | null | null | openpyxl/reader/drawings.py | dangqhuy/openpyxl | 42e929b69b0938b081a62fed529ce470054249fb | [
"MIT"
] | null | null | null | from __future__ import absolute_import
# Copyright (c) 2010-2019 openpyxl
from io import BytesIO
from warnings import warn
from openpyxl.xml.functions import fromstring
from openpyxl.xml.constants import IMAGE_NS
from openpyxl.packaging.relationship import get_rel, get_rels_path, get_dependents
from openpyxl.drawing.... | 32.467742 | 108 | 0.655738 |
79841f09c80b6e103e287d33a6e2a6e53d3c855f | 4,036 | py | Python | scripts/darias_energy_control/_test_simple_tiago_lefthand_base.py | hjw-1014/Multi-Objective-Reactive-Motion-Planning-in-Mobile-Manipulators | 9a8801e9c663174b753c4852b2313c5a3f302434 | [
"MIT"
] | null | null | null | scripts/darias_energy_control/_test_simple_tiago_lefthand_base.py | hjw-1014/Multi-Objective-Reactive-Motion-Planning-in-Mobile-Manipulators | 9a8801e9c663174b753c4852b2313c5a3f302434 | [
"MIT"
] | null | null | null | scripts/darias_energy_control/_test_simple_tiago_lefthand_base.py | hjw-1014/Multi-Objective-Reactive-Motion-Planning-in-Mobile-Manipulators | 9a8801e9c663174b753c4852b2313c5a3f302434 | [
"MIT"
] | null | null | null | import numpy as np
import pybullet as p
import time
import matplotlib.pyplot as plt
from cep.envs import Tiago_LeftParallelHand_Base
from cep.cep_models import cep_simple_model_tiago_lefthand_base
import torch
joint_limit_buffers = 0.02
joint_limits = np.array([2.5, 2.5, 3.1416, 2.75, 1.57, 3.53, 2.35, 2.09, 1.57, 2.... | 27.643836 | 107 | 0.571358 |
79841f64dff48b59ae8e8bcf95bd1951193f4c48 | 31,399 | py | Python | sdk/python/pulumi_aws/lambda_/function.py | JakeGinnivan/pulumi-aws | c91ef78932964ac74eda7f5da81f65b0f1798c93 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/lambda_/function.py | JakeGinnivan/pulumi-aws | c91ef78932964ac74eda7f5da81f65b0f1798c93 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/lambda_/function.py | JakeGinnivan/pulumi-aws | c91ef78932964ac74eda7f5da81f65b0f1798c93 | [
"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 json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables
class Functi... | 67.379828 | 538 | 0.698971 |
79841fc9abad2119d8c96d7ec471bb2fdf77a9f6 | 954 | py | Python | var/spack/repos/builtin/packages/r-proxy/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 9 | 2018-04-18T07:51:40.000Z | 2021-09-10T03:56:57.000Z | var/spack/repos/builtin/packages/r-proxy/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 907 | 2018-04-18T11:17:57.000Z | 2022-03-31T13:20:25.000Z | var/spack/repos/builtin/packages/r-proxy/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 29 | 2018-11-05T16:14:23.000Z | 2022-02-03T16:07:09.000Z | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RProxy(RPackage):
"""Provides an extensible framework for the efficient calculation of
... | 41.478261 | 96 | 0.715933 |
798420491600844873e9f5c4f312891e133419e5 | 1,244 | py | Python | Jarvis_heroesinventory.py | TheImaginativeSkipper/new-proj | f1070ac1f2f345951e8343b50f319c54b23bac1a | [
"MIT"
] | null | null | null | Jarvis_heroesinventory.py | TheImaginativeSkipper/new-proj | f1070ac1f2f345951e8343b50f319c54b23bac1a | [
"MIT"
] | null | null | null | Jarvis_heroesinventory.py | TheImaginativeSkipper/new-proj | f1070ac1f2f345951e8343b50f319c54b23bac1a | [
"MIT"
] | null | null | null | #Ryan Jarvis
#3/23/17
#heros invintory
inv=("steel sword",
"chain mail armor",
"light metal sheild",
"strange yellow potion")
print("your inventory")
for item in inv:
print(item)
input("press the enter key to continue")
#------------------------------------------------
print("... | 18.848485 | 81 | 0.522508 |
7984206df93a1ee6d8784c770dce2b02800ed730 | 893 | py | Python | Chapter09/0904.py | 0201shj/Python-OpenCV | 249f8cc9404e547da0f5c68000f29f2e598562a5 | [
"MIT"
] | null | null | null | Chapter09/0904.py | 0201shj/Python-OpenCV | 249f8cc9404e547da0f5c68000f29f2e598562a5 | [
"MIT"
] | null | null | null | Chapter09/0904.py | 0201shj/Python-OpenCV | 249f8cc9404e547da0f5c68000f29f2e598562a5 | [
"MIT"
] | null | null | null | # 0904.py
import cv2
import numpy as np
src = cv2.imread('./data/chessBoard.jpg')
gray= cv2.cvtColor(src,cv2.COLOR_BGR2GRAY)
#1
params = cv2.SimpleBlobDetector_Params()
params.blobColor = 0
params.thresholdStep = 5
params.minThreshold = 20
params.maxThreshold = 100
params.minDistBetweenBlobs = 5
params... | 23.5 | 57 | 0.694289 |
798420904f38f0fbb970afff42edf061e6db2ac4 | 5,080 | py | Python | cosrlib/searcher.py | commonsearch/cosr-back | 28ca0c1b938dde52bf4f59a835c98dd5ab22cad6 | [
"Apache-2.0"
] | 141 | 2016-02-17T14:27:57.000Z | 2021-12-27T02:56:48.000Z | cosrlib/searcher.py | commonsearch/cosr-back | 28ca0c1b938dde52bf4f59a835c98dd5ab22cad6 | [
"Apache-2.0"
] | 69 | 2016-02-20T02:06:59.000Z | 2017-01-29T22:23:46.000Z | cosrlib/searcher.py | commonsearch/cosr-back | 28ca0c1b938dde52bf4f59a835c98dd5ab22cad6 | [
"Apache-2.0"
] | 38 | 2016-02-25T04:40:07.000Z | 2020-06-11T07:22:44.000Z | from __future__ import absolute_import, division, print_function, unicode_literals
from elasticsearch import Elasticsearch
from .config import config
def format_explain(explain, level=0):
buf = "%s%s | %s\n" % (" " * level, explain["value"], explain["description"])
for child in explain.get("details", [])... | 33.642384 | 109 | 0.491142 |
79842259756363350a6cf1ca8795d17477d1a7f5 | 4,936 | py | Python | Extended_Methods/Downstream_analysis/scripts/1_Remove_compensate_pairs.py | heyuan7676/ts_eQTLs | 62b04f5477183f5c0cb60f21264b3147fd8bd82a | [
"CC-BY-4.0"
] | 19 | 2019-10-02T20:50:08.000Z | 2021-07-21T16:49:21.000Z | Extended_Methods/Downstream_analysis/scripts/1_Remove_compensate_pairs.py | heyuan7676/ts_eQTLs | 62b04f5477183f5c0cb60f21264b3147fd8bd82a | [
"CC-BY-4.0"
] | 2 | 2020-04-07T10:53:35.000Z | 2021-05-15T15:35:51.000Z | Extended_Methods/Downstream_analysis/scripts/1_Remove_compensate_pairs.py | heyuan7676/ts_eQTLs | 62b04f5477183f5c0cb60f21264b3147fd8bd82a | [
"CC-BY-4.0"
] | 1 | 2020-09-14T11:40:55.000Z | 2020-09-14T11:40:55.000Z | from GLOBAL_VAR import *
from METHOD_VAR import *
from sklearn.linear_model import LinearRegression
def readin_YW_BP(prefix, Nrows_to_read = None):
Y = pd.read_csv('%s/%s_slope.txt' % (inputdir, prefix), sep='\t', nrows = Nrows_to_read, index_col=[0,1])
Pairs = np.array(Y.index)
genes = [p[0] for p in P... | 29.035294 | 118 | 0.557942 |
79842280e67ac64be8e3f2c7b72dc3419359d66c | 6,779 | py | Python | src/get_dataset.py | giuliasantarsieri/open_ML | db8cfab3e67b246553db27868183f71cfe3ef4f8 | [
"MIT"
] | 10 | 2021-05-05T15:42:45.000Z | 2021-12-20T22:34:04.000Z | src/get_dataset.py | giuliasantarsieri/open_ML | db8cfab3e67b246553db27868183f71cfe3ef4f8 | [
"MIT"
] | 4 | 2021-07-27T08:46:56.000Z | 2021-08-02T10:40:38.000Z | src/get_dataset.py | giuliasantarsieri/open_ML | db8cfab3e67b246553db27868183f71cfe3ef4f8 | [
"MIT"
] | null | null | null | from pathlib import Path
import requests
import pandas as pd
import os
def latest_catalog():
"""This function returns the pandas dataframe of the latest version of dgf resource catalog
(https://www.data.gouv.fr/en/datasets/catalogue-des-donnees-de-data-gouv-fr/#_)"""
# dgf_catalog = 'https://www.data.gou... | 49.481752 | 141 | 0.61248 |
798422f587a1b0bdbf6caebc46c59749e2c9c1da | 1,438 | py | Python | materialGAN/script_optim.py | NejcHirci/material-addon | c08e2081413c3319b712c2f7193ac8013f601382 | [
"MIT"
] | 4 | 2022-01-31T14:26:39.000Z | 2022-02-06T06:34:27.000Z | materialGAN/script_optim.py | NejcHirci/material-addon | c08e2081413c3319b712c2f7193ac8013f601382 | [
"MIT"
] | 2 | 2021-11-30T12:19:27.000Z | 2021-11-30T12:42:10.000Z | materialGAN/script_optim.py | NejcHirci/material-addon | c08e2081413c3319b712c2f7193ac8013f601382 | [
"MIT"
] | null | null | null | import os
import glob
def gyListNames(in_dir):
dir_list = sorted(glob.glob(in_dir))
fn_list = []
for dir in dir_list:
fn_list.append(os.path.split(dir)[1])
return fn_list
root_dir = 'materialGAN/data/'
in_dir = 'D:/new_materials/'
cp_dir = root_dir + 'pretrain/'
vgg_dir = cp_dir + 'vgg_conv.p... | 29.346939 | 110 | 0.541725 |
79842320d1b8cde78d28f041dbdf5f9120624ad9 | 12,045 | py | Python | DOTA_devkit/ImgSplit_multi_process.py | jedibobo/S2ANet-custom-dataset | 869b196d4c33713a5c61bd80064d10a453fb76ef | [
"Apache-2.0"
] | 2 | 2022-01-18T06:52:31.000Z | 2022-03-31T08:33:32.000Z | DOTA_devkit/ImgSplit_multi_process.py | jedibobo/S2ANet-custom-dataset | 869b196d4c33713a5c61bd80064d10a453fb76ef | [
"Apache-2.0"
] | null | null | null | DOTA_devkit/ImgSplit_multi_process.py | jedibobo/S2ANet-custom-dataset | 869b196d4c33713a5c61bd80064d10a453fb76ef | [
"Apache-2.0"
] | null | null | null | """
-------------
This is the multi-process version
"""
import codecs
import copy
import math
import os
from functools import partial
from multiprocessing import Pool
import cv2
import dota_utils as util
import numpy as np
import shapely.geometry as shgeo
from dota_utils import GetFileFromThisRootDir
def choose_best... | 39.234528 | 124 | 0.499211 |
7984238a80445969ae916b74632ba7cfc589ed81 | 46,082 | py | Python | src/sage/tensor/modules/free_module_morphism.py | fredstro/sage | c936d2cda81ec7ec3552a3bdb29c994b40d1bb24 | [
"BSL-1.0"
] | null | null | null | src/sage/tensor/modules/free_module_morphism.py | fredstro/sage | c936d2cda81ec7ec3552a3bdb29c994b40d1bb24 | [
"BSL-1.0"
] | null | null | null | src/sage/tensor/modules/free_module_morphism.py | fredstro/sage | c936d2cda81ec7ec3552a3bdb29c994b40d1bb24 | [
"BSL-1.0"
] | null | null | null | r"""
Free module morphisms
The class :class:`FiniteRankFreeModuleMorphism` implements homomorphisms
between two free modules of finite rank over the same commutative ring.
AUTHORS:
- Eric Gourgoulhon, Michal Bejger (2014-2015): initial version
REFERENCES:
- Chaps. 13, 14 of R. Godement: *Algebra*, Hermann (Paris) ... | 36.029711 | 143 | 0.498958 |
798424cc159d5f5475fa9960192eeebab8db31d7 | 610 | py | Python | database.py | Urshamunikar/ANPR | b392c3b3f516d689cbebd273f9f035ddb2b83e5a | [
"MIT"
] | null | null | null | database.py | Urshamunikar/ANPR | b392c3b3f516d689cbebd273f9f035ddb2b83e5a | [
"MIT"
] | null | null | null | database.py | Urshamunikar/ANPR | b392c3b3f516d689cbebd273f9f035ddb2b83e5a | [
"MIT"
] | null | null | null | import sqlite3
from sqlite3 import Error
import product
conn = sqlite3.connect('database.db')
c1=conn.cursor()
def read():
lic = product.main()
c1.execute('SELECT * FROM number_plate where plate_number=?',(lic,))
r=c1.fetchone()
if(r!=None):
print("Number Plate Detected")
print("The details of ... | 29.047619 | 71 | 0.622951 |
7984257530e31c99019580d9440dd0ec346381d1 | 1,559 | py | Python | pytorch/models_pretrained/densenet169.py | Wrosinski/dl_frameworks_benchmark | 62d7e408a825c8c287d6fa6afdd53f6cc543f95c | [
"MIT"
] | 4 | 2019-07-24T00:43:36.000Z | 2020-04-29T11:56:47.000Z | pytorch/models_pretrained/densenet169.py | Wrosinski/dl_frameworks_benchmark | 62d7e408a825c8c287d6fa6afdd53f6cc543f95c | [
"MIT"
] | null | null | null | pytorch/models_pretrained/densenet169.py | Wrosinski/dl_frameworks_benchmark | 62d7e408a825c8c287d6fa6afdd53f6cc543f95c | [
"MIT"
] | null | null | null | import numpy as np
import torch
import torchvision
from torch import nn
from torch.nn import functional as F
mean = [0.485, 0.456, 0.406]
std = [0.229, 0.224, 0.225]
mean_ = np.mean(mean)
std_ = np.mean(std)
class DenseNet169(nn.Module):
def __init__(self, parameters):
super().__init__()
self.... | 28.87037 | 77 | 0.579217 |
798425d11fc26cd39e15802edfa7b5e54eea42fe | 4,364 | py | Python | notepad--.py | JonathanPont/Notepad-- | ddbaacc62307fcb9db29f801942fb9284b568d8b | [
"MIT"
] | null | null | null | notepad--.py | JonathanPont/Notepad-- | ddbaacc62307fcb9db29f801942fb9284b568d8b | [
"MIT"
] | null | null | null | notepad--.py | JonathanPont/Notepad-- | ddbaacc62307fcb9db29f801942fb9284b568d8b | [
"MIT"
] | null | null | null | import tkinter as tk, tkinter.font as tk_font
from tkinter.filedialog import askopenfilename, asksaveasfilename
import os
import subprocess
import sys
def exitProgram():
quit()
def newFile(event=None):
global filepath
txt_edit.delete("1.0", tk.END)
window.title("New File")
filepath = ... | 31.854015 | 205 | 0.648488 |
7984285fd03bfcbed3a9dc3eb09c2e551430636f | 11,346 | py | Python | src/db/db_process.py | wenke727/RoadNetworkCreator | a359d2e5c5f0921b1af514c3a88b5e3a25707407 | [
"MIT"
] | null | null | null | src/db/db_process.py | wenke727/RoadNetworkCreator | a359d2e5c5f0921b1af514c3a88b5e3a25707407 | [
"MIT"
] | null | null | null | src/db/db_process.py | wenke727/RoadNetworkCreator | a359d2e5c5f0921b1af514c3a88b5e3a25707407 | [
"MIT"
] | null | null | null | #%%
import os, sys
import geopandas as gpd
import pandas as pd
from sqlalchemy import create_engine
from shapely.geometry import Point, box
sys.path.append("..")
from utils.utils import load_config
config = load_config()
pano_dir = config['data']['pano_dir']
ENGINE = create_engine(config['data']['DB'])
#%%
""... | 33.078717 | 157 | 0.645161 |
79842941930c8aaac6763dcbd30e6b14f3148543 | 11,573 | py | Python | wavepytools/NRA/nra_analyses.py | APS-XSD-OPT-Group/wavepytools | 25397c099e86a8939cc4ee3a2d266e4f809a1d18 | [
"MIT"
] | 3 | 2019-04-12T18:28:00.000Z | 2020-11-17T18:33:01.000Z | wavepytools/NRA/nra_analyses.py | APS-XSD-OPT-Group/wavepytools | 25397c099e86a8939cc4ee3a2d266e4f809a1d18 | [
"MIT"
] | null | null | null | wavepytools/NRA/nra_analyses.py | APS-XSD-OPT-Group/wavepytools | 25397c099e86a8939cc4ee3a2d266e4f809a1d18 | [
"MIT"
] | 3 | 2019-04-19T16:46:54.000Z | 2021-02-10T18:49:06.000Z | #! /bin/python
# -*- coding: utf-8 -*- #
"""
Created on Tue Oct 08
@author: wcgrizolli
"""
#import dxchange
from pywinspec import SpeFile, test_headers
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
from matplotlib import cm
import numpy as np
import sys
sys.path.append('/home/grizoll... | 24.364211 | 94 | 0.576687 |
7984297ff89a01c114cce3a3cd5bd58e540ea611 | 1,404 | py | Python | 401d10/data_structures/queue/queue.py | RogerHuba/data_structures_and_algorithms | 417b651d74104ebca1e616fb4d8e6bc84c94aa61 | [
"MIT"
] | 1 | 2021-05-04T16:14:54.000Z | 2021-05-04T16:14:54.000Z | 401d10/data_structures/queue/queue.py | RogerHuba/data_structures_and_algorithms | 417b651d74104ebca1e616fb4d8e6bc84c94aa61 | [
"MIT"
] | 15 | 2018-11-28T01:10:48.000Z | 2022-03-11T23:53:26.000Z | 401d10/data_structures/queue/queue.py | RogerHuba/data_structures_and_algorithms | 417b651d74104ebca1e616fb4d8e6bc84c94aa61 | [
"MIT"
] | 2 | 2019-11-02T17:37:17.000Z | 2020-02-23T01:48:24.000Z | from .node import Node
class Queue(object):
"""Creates queue object"""
def _init__(self, _iterable=None):
"""Creates a Queue"""
self.front = None
self.back = None
self._size = 0
if _iterable:
if type(_iterable) is list:
for value in _iterabl... | 25.071429 | 64 | 0.5 |
79842a1c53b4d5b1ed5aeeaefc64802fb99ef05d | 3,114 | py | Python | organize/filters/filename.py | rawdamedia/organize | 0037d5316d79d312ba4459d22f5ff6df09cce55c | [
"MIT"
] | null | null | null | organize/filters/filename.py | rawdamedia/organize | 0037d5316d79d312ba4459d22f5ff6df09cce55c | [
"MIT"
] | null | null | null | organize/filters/filename.py | rawdamedia/organize | 0037d5316d79d312ba4459d22f5ff6df09cce55c | [
"MIT"
] | null | null | null | from typing import Any, List, Mapping, Union
from organize.compat import Path
from .filter import Filter
class Filename(Filter):
"""
Match files by filename
:param str startswith:
The filename must begin with the given string
:param str contains:
The filename must contain the give... | 29.102804 | 88 | 0.512524 |
79842bb6598713b199053a4b9ff18ae789e916c8 | 9,603 | py | Python | doc/source/conf.py | cloudscale-ch/openstack-ansible-os_octavia | 55fde3ba2aebc229ee38c27c665b71b70b729233 | [
"Apache-2.0"
] | 13 | 2017-01-03T15:06:33.000Z | 2021-12-15T16:46:08.000Z | doc/source/conf.py | cloudscale-ch/openstack-ansible-os_octavia | 55fde3ba2aebc229ee38c27c665b71b70b729233 | [
"Apache-2.0"
] | null | null | null | doc/source/conf.py | cloudscale-ch/openstack-ansible-os_octavia | 55fde3ba2aebc229ee38c27c665b71b70b729233 | [
"Apache-2.0"
] | 14 | 2017-02-28T20:10:05.000Z | 2022-03-02T21:31:08.000Z | #!/usr/bin/env python3
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software... | 33.228374 | 79 | 0.716443 |
79842cbc9c54b0079d0e6c87c7b379f06a0b4100 | 1,152 | py | Python | reviews/migrations/0001_initial.py | fiza1160/we-go-trip-test | 293fc736a9e27fc1a37c412f20caa0c5ace8ac23 | [
"MIT"
] | null | null | null | reviews/migrations/0001_initial.py | fiza1160/we-go-trip-test | 293fc736a9e27fc1a37c412f20caa0c5ace8ac23 | [
"MIT"
] | null | null | null | reviews/migrations/0001_initial.py | fiza1160/we-go-trip-test | 293fc736a9e27fc1a37c412f20caa0c5ace8ac23 | [
"MIT"
] | null | null | null | # Generated by Django 4.0.2 on 2022-02-19 14:09
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AU... | 34.909091 | 151 | 0.625868 |
79842d05d21188ace1320020c67ecdb024478a24 | 2,278 | py | Python | frameworks/hyperts_arima/run.py | DataCanvasIO/TSBenchmark | e8e45cd0cd206723ad59a8cac2a572e48f43a728 | [
"Apache-2.0"
] | 2 | 2022-03-28T02:10:09.000Z | 2022-03-29T02:56:26.000Z | frameworks/hyperts_arima/run.py | DataCanvasIO/TSBenchmark | e8e45cd0cd206723ad59a8cac2a572e48f43a728 | [
"Apache-2.0"
] | null | null | null | frameworks/hyperts_arima/run.py | DataCanvasIO/TSBenchmark | e8e45cd0cd206723ad59a8cac2a572e48f43a728 | [
"Apache-2.0"
] | null | null | null | from utils.util import convertdf
import time
from hyperts.framework.search_space.macro_search_space import StatsForecastSearchSpace
def trail(df_train, df_test, Date_Col_Name, Series_Col_name, forecast_length, format, task, metric, covariables,
max_trials, random_state, reward_metric):
# load data
d... | 39.964912 | 117 | 0.605795 |
79842de5c0860b26c28594ae7db144f92e9447a0 | 6,363 | py | Python | tests/integration/test_notebooks_gpu.py | mlnethub/recommenders | a744690785455f75a633ce43b67d8ad5a79d5cd7 | [
"MIT"
] | 3 | 2019-12-13T22:35:55.000Z | 2020-01-05T22:19:56.000Z | tests/integration/test_notebooks_gpu.py | dewott-technologies/recommenders | cadf54f8db4edbcd46b4330f58823befa8441319 | [
"MIT"
] | 1 | 2019-12-10T16:58:51.000Z | 2019-12-10T16:58:51.000Z | tests/integration/test_notebooks_gpu.py | shedar/recommenders | 7c0a6a3e23dee047b9afbf8564bd236a8300454e | [
"MIT"
] | 4 | 2019-06-05T00:04:11.000Z | 2019-06-08T02:20:35.000Z | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import papermill as pm
import pytest
from reco_utils.common.gpu_utils import get_number_gpus
from tests.notebooks_common import OUTPUT_NOTEBOOK, KERNEL_NAME
TOL = 0.5
ABS_TOL = 0.05
@pytest.mark.integration
@pytest.mark.gp... | 29.458333 | 116 | 0.566557 |
79842e4a1d2a95c01835247d28f8c8830fc7bffd | 1,953 | py | Python | tests/tests.py | chrissem/COCO-Assistant | e5adf4d59cd9a2a51b8770988c949cfed19e8516 | [
"MIT"
] | null | null | null | tests/tests.py | chrissem/COCO-Assistant | e5adf4d59cd9a2a51b8770988c949cfed19e8516 | [
"MIT"
] | null | null | null | tests/tests.py | chrissem/COCO-Assistant | e5adf4d59cd9a2a51b8770988c949cfed19e8516 | [
"MIT"
] | null | null | null | import os
import shutil
import tarfile
from coco_assistant import COCO_Assistant
import data_getter
from pycocotools.coco import COCO
import pytest
@pytest.fixture
def get_data():
if os.path.isdir('./annotations') is False and os.path.isdir('./images') is False:
# Download and extract data
print("Downloadin... | 26.753425 | 89 | 0.730671 |
79842e6e5c7e9d501d67456b2c821861d333a370 | 475 | py | Python | mne/viz/_brain/__init__.py | ragatti/mne-python | c6825a49c3452db616fc980d62d33f6dddf4cd65 | [
"BSD-3-Clause"
] | 2 | 2020-06-15T12:25:12.000Z | 2020-09-13T11:49:51.000Z | mne/viz/_brain/__init__.py | Moonshadowzb/mne-python | 89647f3363fcb5de306cc18e55e7b9fa89fe0315 | [
"BSD-3-Clause"
] | 1 | 2019-11-15T06:47:33.000Z | 2019-11-22T14:11:41.000Z | mne/viz/_brain/__init__.py | Moonshadowzb/mne-python | 89647f3363fcb5de306cc18e55e7b9fa89fe0315 | [
"BSD-3-Clause"
] | null | null | null | """Plot Cortex Surface."""
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Eric Larson <larson.eric.d@gmail.com>
# Oleh Kozynets <ok7mailbox@gmail.com>
# Guillaume Favelier <guillaume.favelier@gmail.com>
# jona-sassenhagen <jona.sassenhagen@gmail.com>
# Joan M... | 29.6875 | 60 | 0.690526 |
79842ef460ccfb4c054208c3205b1c157ab73ee2 | 106,561 | py | Python | wrappers/python_2-7/wpwithin/WPWithin.py | UpperLEFTY/worldpay-within-sdk | 5651b9b4be08faa83ba46735b2ce14d5fcbb515f | [
"MIT"
] | null | null | null | wrappers/python_2-7/wpwithin/WPWithin.py | UpperLEFTY/worldpay-within-sdk | 5651b9b4be08faa83ba46735b2ce14d5fcbb515f | [
"MIT"
] | null | null | null | wrappers/python_2-7/wpwithin/WPWithin.py | UpperLEFTY/worldpay-within-sdk | 5651b9b4be08faa83ba46735b2ce14d5fcbb515f | [
"MIT"
] | null | null | null | #
# Autogenerated by Thrift Compiler (0.10.0)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py
#
from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException
from thrift.protocol.TProtocol import TProtocolException
import sys
import logging
f... | 35.018403 | 165 | 0.588677 |
79842ef620b7b4f6db3ec7e57cc0c400358f5270 | 8,369 | py | Python | ldclient/impl/integrations/dynamodb/dynamodb_feature_store.py | gangeli/python-server-sdk | 3095315fd53c3bf723b0f16b0c18acadef4dfb3e | [
"Apache-2.0"
] | null | null | null | ldclient/impl/integrations/dynamodb/dynamodb_feature_store.py | gangeli/python-server-sdk | 3095315fd53c3bf723b0f16b0c18acadef4dfb3e | [
"Apache-2.0"
] | null | null | null | ldclient/impl/integrations/dynamodb/dynamodb_feature_store.py | gangeli/python-server-sdk | 3095315fd53c3bf723b0f16b0c18acadef4dfb3e | [
"Apache-2.0"
] | null | null | null | import json
have_dynamodb = False
try:
import boto3
have_dynamodb = True
except ImportError:
pass
from ldclient import log
from ldclient.feature_store import CacheConfig
from ldclient.feature_store_helpers import CachingStoreWrapper
from ldclient.interfaces import DiagnosticDescription, FeatureStore, Feat... | 42.917949 | 127 | 0.641295 |
79842f8c1d9a32db405f7c5d17378a0cc701f6a8 | 10,766 | py | Python | tests/calculations/test_predicted_team.py | frc1678/server-2021-public | d61e35f8385bf1debc9daaaed40208f6c783ed77 | [
"MIT"
] | null | null | null | tests/calculations/test_predicted_team.py | frc1678/server-2021-public | d61e35f8385bf1debc9daaaed40208f6c783ed77 | [
"MIT"
] | null | null | null | tests/calculations/test_predicted_team.py | frc1678/server-2021-public | d61e35f8385bf1debc9daaaed40208f6c783ed77 | [
"MIT"
] | null | null | null | from calculations import predicted_team
import server
from unittest import mock
class TestPredictedTeamCalc:
def setup_method(self, method):
self.test_server = server.Server()
self.test_calc = predicted_team.PredictedTeamCalc(self.test_server)
self.predicted_aim = [
{
... | 41.567568 | 101 | 0.524707 |
79843233138fe29bbc6432d36fc7da119505bbc4 | 1,337 | py | Python | translate/cloud-client/snippets_test.py | thecloudist/python-docs-samples | efe65f1e89ad8f5c1305084b1526a62595f9e732 | [
"Apache-2.0"
] | null | null | null | translate/cloud-client/snippets_test.py | thecloudist/python-docs-samples | efe65f1e89ad8f5c1305084b1526a62595f9e732 | [
"Apache-2.0"
] | null | null | null | translate/cloud-client/snippets_test.py | thecloudist/python-docs-samples | efe65f1e89ad8f5c1305084b1526a62595f9e732 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2016 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 ... | 31.093023 | 74 | 0.74196 |
798432872b86b57a0363352468cda6f74a17c737 | 1,569 | py | Python | Object-Oriented/2-Class-Instance-Variables/oop.py | MohGumaa/code_snippets | a5482a908bbc1575a4cc8cd408b9c183eb510cb0 | [
"MIT"
] | null | null | null | Object-Oriented/2-Class-Instance-Variables/oop.py | MohGumaa/code_snippets | a5482a908bbc1575a4cc8cd408b9c183eb510cb0 | [
"MIT"
] | null | null | null | Object-Oriented/2-Class-Instance-Variables/oop.py | MohGumaa/code_snippets | a5482a908bbc1575a4cc8cd408b9c183eb510cb0 | [
"MIT"
] | null | null | null | class Employee:
num_of_emps = 0
raise_amount = 1.05
def __init__(self, first, last, pay):
self.first = first
self.last = last
self.email = first + '.' + last + '@email.com'
self.pay = pay
Employee.num_of_emps += 1
def fullname(self):
return '{} {}'.for... | 22.098592 | 83 | 0.695985 |
7984330247cd4e7b3a689ccccb8adaf3f2ba9a98 | 69,290 | py | Python | neutron/db/l3_db.py | mrwukang/neutron | ebdb2ad1213eaf09c6a3f061a94ff4453c3e7506 | [
"Apache-2.0"
] | 1 | 2019-01-13T04:42:21.000Z | 2019-01-13T04:42:21.000Z | neutron/db/l3_db.py | mrwukang/neutron | ebdb2ad1213eaf09c6a3f061a94ff4453c3e7506 | [
"Apache-2.0"
] | null | null | null | neutron/db/l3_db.py | mrwukang/neutron | ebdb2ad1213eaf09c6a3f061a94ff4453c3e7506 | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 VMware, 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 a... | 46.88092 | 79 | 0.599221 |
798436847e6f1870e0cb107d64779457ec82eab0 | 4,842 | py | Python | toontown/coghq/LawbotCogHQLoader.py | LittleNed/toontown-stride | 1252a8f9a8816c1810106006d09c8bdfe6ad1e57 | [
"Apache-2.0"
] | 3 | 2020-01-02T08:43:36.000Z | 2020-07-05T08:59:02.000Z | toontown/coghq/LawbotCogHQLoader.py | NoraTT/Historical-Commits-Project-Altis-Source | fe88e6d07edf418f7de6ad5b3d9ecb3d0d285179 | [
"Apache-2.0"
] | null | null | null | toontown/coghq/LawbotCogHQLoader.py | NoraTT/Historical-Commits-Project-Altis-Source | fe88e6d07edf418f7de6ad5b3d9ecb3d0d285179 | [
"Apache-2.0"
] | 4 | 2019-06-20T23:45:23.000Z | 2020-10-14T20:30:15.000Z | from toontown.coghq import CogHQLoader
from toontown.coghq import LawbotHQBossBattle
from toontown.coghq import LawbotHQExterior
from toontown.coghq import LawbotOfficeExterior
from toontown.coghq import StageInterior
from direct.directnotify import DirectNotifyGlobal
from direct.fsm import State
from direct.fsm import... | 42.473684 | 142 | 0.700537 |
798439c957c789974c4faab8f3369226bc160b41 | 23,666 | py | Python | prysm/mtf_utils.py | samkberry/prysm | 3c17cb7b6049a36a1f8b6a0035c216ca1078aee1 | [
"MIT"
] | null | null | null | prysm/mtf_utils.py | samkberry/prysm | 3c17cb7b6049a36a1f8b6a0035c216ca1078aee1 | [
"MIT"
] | null | null | null | prysm/mtf_utils.py | samkberry/prysm | 3c17cb7b6049a36a1f8b6a0035c216ca1078aee1 | [
"MIT"
] | null | null | null | """Utilities for working with MTF data."""
import operator
from scipy.interpolate import griddata, RegularGridInterpolator as RGI
from .util import share_fig_ax
from .io import read_trioptics_mtf_vs_field, read_trioptics_mtfvfvf
from prysm import mathops as m
class MTFvFvF(object):
"""Abstract object represent... | 34.448326 | 107 | 0.570946 |
79843a0a7be460a0c476ea90502761a52d9734c9 | 2,075 | py | Python | steam/ext/tf2/protobufs/__init__.py | olifog/steam-ext-tf2 | 15d1c72d4b690ccda1309ae35558f5a3655badad | [
"MIT"
] | null | null | null | steam/ext/tf2/protobufs/__init__.py | olifog/steam-ext-tf2 | 15d1c72d4b690ccda1309ae35558f5a3655badad | [
"MIT"
] | null | null | null | steam/ext/tf2/protobufs/__init__.py | olifog/steam-ext-tf2 | 15d1c72d4b690ccda1309ae35558f5a3655badad | [
"MIT"
] | null | null | null | from steam.protobufs import PROTOBUFS
from ..enums import Language
from . import base as base, sdk, struct_messages
PROTOBUFS.update(
{
Language.SOUpdate: sdk.SingleObject,
Language.SOCreate: sdk.SingleObject,
Language.SOUpdateMultiple: sdk.MultipleObjects,
Language.GameServerReset... | 48.255814 | 80 | 0.758554 |
79843aa10dc927bee0e69af5b5f0cb694478a7d0 | 2,011 | py | Python | cryptography/key_press/__init__.py | JASTYN/pythonmaster | 46638ab09d28b65ce5431cd0759fe6df272fb85d | [
"Apache-2.0",
"MIT"
] | 3 | 2017-05-02T10:28:13.000Z | 2019-02-06T09:10:11.000Z | cryptography/key_press/__init__.py | JASTYN/pythonmaster | 46638ab09d28b65ce5431cd0759fe6df272fb85d | [
"Apache-2.0",
"MIT"
] | 2 | 2017-06-21T20:39:14.000Z | 2020-02-25T10:28:57.000Z | cryptography/key_press/__init__.py | JASTYN/pythonmaster | 46638ab09d28b65ce5431cd0759fe6df272fb85d | [
"Apache-2.0",
"MIT"
] | 2 | 2016-07-29T04:35:22.000Z | 2017-01-18T17:05:36.000Z | class KeyPress(object):
def __init__(self, phrase):
self.phrase = phrase
def presses(self):
"""
Create the dictionary to store the numbers as keys and the list of strings as values
Create a counter variable to store counts whenever a letter is found in the key-value pairing.
... | 45.704545 | 111 | 0.488314 |
79843b4e4c32be42134402b87a8023e2de95cb46 | 1,054 | py | Python | deep-rl/lib/python2.7/site-packages/OpenGL/GL/ARB/occlusion_query2.py | ShujaKhalid/deep-rl | 99c6ba6c3095d1bfdab81bd01395ced96bddd611 | [
"MIT"
] | 210 | 2016-04-09T14:26:00.000Z | 2022-03-25T18:36:19.000Z | deep-rl/lib/python2.7/site-packages/OpenGL/GL/ARB/occlusion_query2.py | ShujaKhalid/deep-rl | 99c6ba6c3095d1bfdab81bd01395ced96bddd611 | [
"MIT"
] | 72 | 2016-09-04T09:30:19.000Z | 2022-03-27T17:06:53.000Z | deep-rl/lib/python2.7/site-packages/OpenGL/GL/ARB/occlusion_query2.py | ShujaKhalid/deep-rl | 99c6ba6c3095d1bfdab81bd01395ced96bddd611 | [
"MIT"
] | 64 | 2016-04-09T14:26:49.000Z | 2022-03-21T11:19:47.000Z | '''OpenGL extension ARB.occlusion_query2
This module customises the behaviour of the
OpenGL.raw.GL.ARB.occlusion_query2 to provide a more
Python-friendly API
Overview (from the spec)
This extension trivially adds a boolean occlusion query
to ARB_occlusion_query.
While the counter-based occlusion query provid... | 32.9375 | 71 | 0.808349 |
79843d9e7613781c1f2283919f586f494bb03d28 | 3,174 | py | Python | users/views.py | anjalika-mohanty/Internship-Project | f7e8a6627b694ef3f35a297a9df768e74a7bca6b | [
"bzip2-1.0.6"
] | null | null | null | users/views.py | anjalika-mohanty/Internship-Project | f7e8a6627b694ef3f35a297a9df768e74a7bca6b | [
"bzip2-1.0.6"
] | null | null | null | users/views.py | anjalika-mohanty/Internship-Project | f7e8a6627b694ef3f35a297a9df768e74a7bca6b | [
"bzip2-1.0.6"
] | 1 | 2020-01-30T07:41:04.000Z | 2020-01-30T07:41:04.000Z | from django.shortcuts import render,redirect
from django.http import HttpResponse
from users.models import User
from django.contrib import messages
# Create your views here.
def index(request):
return render(request,'users/users.html')
def login_user(request):
if request.method == 'POST':
... | 41.763158 | 314 | 0.661626 |
79843e9d7293eb6818a3f6373b5f3f976467ef6c | 1,710 | py | Python | release/stubs.min/Autodesk/Revit/DB/__init___parts/PlanarFace.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | release/stubs.min/Autodesk/Revit/DB/__init___parts/PlanarFace.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | release/stubs.min/Autodesk/Revit/DB/__init___parts/PlanarFace.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | class PlanarFace(Face, IDisposable):
""" A bounded face of a 3d solid or open shell. """
def Dispose(self):
""" Dispose(self: APIObject,A_0: bool) """
pass
def ReleaseManagedResources(self, *args):
""" ReleaseManagedResources(self: APIObject) """
pass
def Re... | 23.424658 | 221 | 0.602924 |
79843ef4f646c9b4262efd64b26bf688cdcfbc52 | 1,145 | py | Python | SquidskiBot/SquidskiBotMain/Commands/help.py | 18swenskiq/Squidski-Bot-PY | f711d6c837c8e04fdeada7a76c278923b4e2220e | [
"MIT"
] | 1 | 2019-04-29T18:07:28.000Z | 2019-04-29T18:07:28.000Z | SquidskiBot/SquidskiBotMain/Commands/help.py | 18swenskiq/Squidski-Bot-PY | f711d6c837c8e04fdeada7a76c278923b4e2220e | [
"MIT"
] | null | null | null | SquidskiBot/SquidskiBotMain/Commands/help.py | 18swenskiq/Squidski-Bot-PY | f711d6c837c8e04fdeada7a76c278923b4e2220e | [
"MIT"
] | 2 | 2019-06-17T16:22:13.000Z | 2019-08-27T15:58:36.000Z | import discord
class help():
# Builds a discord embed object to display as the help message
async def myEmbed(self, message):
embed = discord.Embed(title="Squidski-Bot PY", description="I am a bot made by Squidski#9545. I can do multiple things and I am still in development", color=0x00ff00)
e... | 60.263158 | 174 | 0.70131 |
79843f60625f3f32f7c267bc0a7d2853d7e4ad3d | 3,760 | py | Python | graphics.py | sky3947/CursesMinesweeper | 3ae128a98f12b069fd4d0b146a43743d3db99bea | [
"MIT"
] | null | null | null | graphics.py | sky3947/CursesMinesweeper | 3ae128a98f12b069fd4d0b146a43743d3db99bea | [
"MIT"
] | null | null | null | graphics.py | sky3947/CursesMinesweeper | 3ae128a98f12b069fd4d0b146a43743d3db99bea | [
"MIT"
] | null | null | null | """
This file provides functions to interface with the curses library.
"""
import curses
from utility import Point
class Graphics:
"""
A class for interfacting with curses functions.
"""
# The length and height of the draw window.
LENGTH = 60
HEIGHT = 30
# Text decoration options.
... | 25.578231 | 73 | 0.564894 |
79843f91e0e2c3d6edfb136ccd73e83232821b97 | 7,664 | py | Python | comparing-rnn-params/model/trainer.py | pasinducw/scs-4224-fyp | 753dd2cc6db84bcb9823a24ce5f495d94f55b162 | [
"MIT"
] | 1 | 2021-08-14T06:29:25.000Z | 2021-08-14T06:29:25.000Z | comparing-rnn-params/model/trainer.py | pasinducw/university-work-scs-4224 | 9ff208e31ddd17146dac2226ac5474bd7fe98ab2 | [
"MIT"
] | null | null | null | comparing-rnn-params/model/trainer.py | pasinducw/university-work-scs-4224 | 9ff208e31ddd17146dac2226ac5474bd7fe98ab2 | [
"MIT"
] | null | null | null | import copy
import math
import os
import torch
from torch.utils.data import DataLoader
import numpy as np
import matplotlib.pyplot as plt
import librosa
import librosa.display
from model import Model
from dataset import Covers80DatasetPerformanceChunks
import argparse
parser = argparse.ArgumentParser(
descrip... | 41.427027 | 157 | 0.663231 |
79843fa9e748f648f7d717d90f2787ad2350b76f | 3,997 | py | Python | mayan/apps/mailer/forms.py | eshbeata/open-paperless | 6b9ed1f21908116ad2795b3785b2dbd66713d66e | [
"Apache-2.0"
] | 2,743 | 2017-12-18T07:12:30.000Z | 2022-03-27T17:21:25.000Z | mayan/apps/mailer/forms.py | eshbeata/open-paperless | 6b9ed1f21908116ad2795b3785b2dbd66713d66e | [
"Apache-2.0"
] | 15 | 2020-06-06T00:00:48.000Z | 2022-03-12T00:03:54.000Z | mayan/apps/mailer/forms.py | eshbeata/open-paperless | 6b9ed1f21908116ad2795b3785b2dbd66713d66e | [
"Apache-2.0"
] | 257 | 2017-12-18T03:12:58.000Z | 2022-03-25T08:59:10.000Z | from __future__ import unicode_literals
import json
from django import forms
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from acls.models import AccessControlList
from common.forms import DynamicModelForm
from .classes import MailerBackend
from .models import UserMailer
... | 33.588235 | 78 | 0.643983 |
798440719c363b0b4a7c5c9cdd9cc4c688878753 | 1,076 | py | Python | ex059.py | raquelEllem/exerciciosPython | 489c2360de84c69dbe9da7710660fb064cd605fa | [
"MIT"
] | null | null | null | ex059.py | raquelEllem/exerciciosPython | 489c2360de84c69dbe9da7710660fb064cd605fa | [
"MIT"
] | null | null | null | ex059.py | raquelEllem/exerciciosPython | 489c2360de84c69dbe9da7710660fb064cd605fa | [
"MIT"
] | null | null | null | num1 = float(input('Primeiro valor: '))
num2 = float(input('Segundo valor: '))
opcao = 0
while opcao != 5:
print('[ 1 ] somar')
print('[ 2 ] multiplicar')
print('[ 3 ] maior')
print('[ 4 ] novos números')
print('[ 5 ] sair do programa')
opcao = int(input('Qual é a sua opção? '))
if opcao == ... | 31.647059 | 82 | 0.484201 |
798440f41e280577de03abff7aaca5cba5a1bb08 | 1,806 | py | Python | agent/src/agent/cli/prompt/pipeline/jdbc.py | anodot/daria | d475899309f56cd85347be0f7001a0dd97dd197a | [
"Apache-2.0"
] | 16 | 2019-04-03T08:31:54.000Z | 2021-01-24T17:12:04.000Z | agent/src/agent/cli/prompt/pipeline/jdbc.py | anodot/daria | d475899309f56cd85347be0f7001a0dd97dd197a | [
"Apache-2.0"
] | 10 | 2020-01-20T14:59:06.000Z | 2022-01-21T10:19:16.000Z | agent/src/agent/cli/prompt/pipeline/jdbc.py | anodot/daria | d475899309f56cd85347be0f7001a0dd97dd197a | [
"Apache-2.0"
] | 5 | 2021-01-08T19:23:03.000Z | 2021-11-09T14:15:49.000Z | import click
from agent.modules.tools import infinite_retry
from agent.pipeline.validators import jdbc_query
from .base import Prompter
class JDBCPrompter(Prompter):
timestamp_types = ['datetime', 'unix', 'unix_ms']
def prompt_config(self):
self.set_query()
self.data_preview()
self.p... | 39.26087 | 115 | 0.609081 |
79844131c0a57508040c0a65014204061ad93ac7 | 37,329 | py | Python | stattools/mixture/gaussian.py | artemmavrin/SLTools | 04525b5d6777be3ccdc6ad44e4cbfe24a8875933 | [
"MIT"
] | 2 | 2018-07-10T22:16:23.000Z | 2019-10-08T00:12:44.000Z | stattools/mixture/gaussian.py | artemmavrin/SLTools | 04525b5d6777be3ccdc6ad44e4cbfe24a8875933 | [
"MIT"
] | null | null | null | stattools/mixture/gaussian.py | artemmavrin/SLTools | 04525b5d6777be3ccdc6ad44e4cbfe24a8875933 | [
"MIT"
] | 4 | 2019-05-17T23:06:07.000Z | 2021-03-22T14:04:24.000Z | """Estimation and simulation for Gaussian mixture models."""
import itertools
import numbers
import matplotlib.pyplot as plt
import numpy as np
import scipy.stats as st
from ..cluster import KMeansCluster
from ..generic import Classifier
from ..utils.validation import validate_bool
from ..utils.validation import val... | 38.129724 | 80 | 0.615018 |
7984418d00dd7f17b529ca8ba4a9dbb6ba22f52a | 3,908 | py | Python | api/app/core/strings.py | Crowd-Wire/CrowdWire | 945896ea693ccacfd5baf8f39ef0f715bbba3ac0 | [
"MIT"
] | 16 | 2021-06-17T00:21:40.000Z | 2022-03-29T08:48:03.000Z | api/app/core/strings.py | Crowd-Wire/CrowdWire | 945896ea693ccacfd5baf8f39ef0f715bbba3ac0 | [
"MIT"
] | null | null | null | api/app/core/strings.py | Crowd-Wire/CrowdWire | 945896ea693ccacfd5baf8f39ef0f715bbba3ac0 | [
"MIT"
] | 2 | 2021-08-10T11:55:51.000Z | 2021-11-18T23:05:42.000Z | # Errors
USER_NOT_IN_WORLD = "User is not registered in this world."
INVALID_CREDENTIALS = "Invalid email or password."
INVALID_PASSWORD = "Invalid password."
EMAIl_ALREADY_IN_USE = "A user with that email already exists."
INACTIVE_USER = "User is Inactive or the account has been banned."
INVALID_TAG = "Invalid Tag. Ta... | 63.032258 | 110 | 0.811924 |
798443682ab7d6fd72b24634b67120dbbe428b9a | 1,936 | py | Python | models/hedln.py | jiabijue/md_mrle | 21830842ca4e663153b9abb94ca2db604059a91f | [
"MIT"
] | 3 | 2021-06-14T18:50:57.000Z | 2022-03-21T02:25:48.000Z | models/hedln.py | jiabijue/md_mrle | 21830842ca4e663153b9abb94ca2db604059a91f | [
"MIT"
] | 1 | 2021-01-26T20:40:58.000Z | 2021-01-26T20:40:58.000Z | models/hedln.py | jiabijue/md_mrle | 21830842ca4e663153b9abb94ca2db604059a91f | [
"MIT"
] | 1 | 2021-11-23T11:51:36.000Z | 2021-11-23T11:51:36.000Z | import torch
import torch.nn as nn
class HEDLN(nn.Module):
def __init__(self, input_size, hidden_size, num_layers,
dropout, bidirectional, num_classes1, num_classes2):
super(HEDLN, self).__init__()
self.num_directions = 2 if bidirectional else 1
self.num_classes1 ... | 37.960784 | 78 | 0.590909 |
7984439515cf6b993ee387129842707282b289b8 | 3,024 | py | Python | scripts/sequence_clusters/expansion/draw_general_tree.py | mahajrod/MAVR | 4db74dff7376a2ffe4426db720b241de9198f329 | [
"MIT"
] | 10 | 2015-04-28T14:15:04.000Z | 2021-03-15T00:07:38.000Z | scripts/sequence_clusters/expansion/draw_general_tree.py | mahajrod/MAVR | 4db74dff7376a2ffe4426db720b241de9198f329 | [
"MIT"
] | null | null | null | scripts/sequence_clusters/expansion/draw_general_tree.py | mahajrod/MAVR | 4db74dff7376a2ffe4426db720b241de9198f329 | [
"MIT"
] | 6 | 2017-03-16T22:38:41.000Z | 2021-08-11T00:22:52.000Z | #!/usr/bin/env python
import argparse
from ete3 import Tree, TreeStyle, AttrFace, faces
def layout(node):
if node.up is not None:
attr = AttrFace("expansion", fsize=7, fgcolor="green", text_prefix="+")
faces.add_face_to_node(attr, node, 0, position="branch-top")
attr = AttrFace("decrease",... | 38.769231 | 100 | 0.717593 |
79844426f1fa6cd8675debb0f25a2c50cebbf58f | 20,381 | py | Python | django/test/client.py | graingert/django | 784d0c261c76535dc760bc8d76793d92f35c1513 | [
"BSD-3-Clause"
] | 1 | 2020-08-08T01:55:00.000Z | 2020-08-08T01:55:00.000Z | django/test/client.py | graingert/django | 784d0c261c76535dc760bc8d76793d92f35c1513 | [
"BSD-3-Clause"
] | null | null | null | django/test/client.py | graingert/django | 784d0c261c76535dc760bc8d76793d92f35c1513 | [
"BSD-3-Clause"
] | null | null | null | import urllib
import sys
import os
import re
import mimetypes
from copy import copy
from io import BytesIO
from urlparse import urlparse, urlsplit
from django.conf import settings
from django.contrib.auth import authenticate, login
from django.core.handlers.base import BaseHandler
from django.core.handlers.wsgi import... | 37.327839 | 112 | 0.606643 |
798445384da00c33c04a1f95a56d3b7203db6b5d | 11,484 | py | Python | ironic_python_agent/burnin.py | openstack/ironic-python-agent | 0b69890c114e6527d55b0c9ce4817bdb66faaede | [
"Apache-2.0"
] | 86 | 2015-01-21T22:04:48.000Z | 2022-03-29T12:15:49.000Z | ironic_python_agent/burnin.py | openstack/ironic-python-agent | 0b69890c114e6527d55b0c9ce4817bdb66faaede | [
"Apache-2.0"
] | 3 | 2018-01-29T07:44:43.000Z | 2021-09-04T06:13:42.000Z | ironic_python_agent/burnin.py | openstack/ironic-python-agent | 0b69890c114e6527d55b0c9ce4817bdb66faaede | [
"Apache-2.0"
] | 110 | 2015-01-29T09:26:52.000Z | 2021-12-29T03:16:27.000Z | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the ... | 37.529412 | 77 | 0.629572 |
79844554ab1156ac433193fa459b46f96c4f8f1b | 646 | py | Python | python/src/cmdline/make_struct_pickle.py | hgmelectronics/xcpsetup | 646d22537f58e59c3fe324da08c4dbe0d5881efa | [
"BSD-2-Clause"
] | null | null | null | python/src/cmdline/make_struct_pickle.py | hgmelectronics/xcpsetup | 646d22537f58e59c3fe324da08c4dbe0d5881efa | [
"BSD-2-Clause"
] | null | null | null | python/src/cmdline/make_struct_pickle.py | hgmelectronics/xcpsetup | 646d22537f58e59c3fe324da08c4dbe0d5881efa | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/python3
import argparse
import sys
if not '..' in sys.path:
sys.path.append('..')
import pyclibrary
parser = argparse.ArgumentParser(description="makes a pickled struct definition file from a C header, for use with read_struct and write_struct")
parser.add_argument('inputFile', help="Input file n... | 34 | 145 | 0.778638 |
7984462f4b8a2c8564fb863d47cca69f06eab141 | 10,071 | py | Python | scripts/automation/trex_control_plane/unit_tests/sock.py | timgates42/trex-core | efe94752fcb2d0734c83d4877afe92a3dbf8eccd | [
"Apache-2.0"
] | 956 | 2015-06-24T15:04:55.000Z | 2022-03-30T06:25:04.000Z | scripts/automation/trex_control_plane/unit_tests/sock.py | angelyouyou/trex-core | fddf78584cae285d9298ef23f9f5c8725e16911e | [
"Apache-2.0"
] | 782 | 2015-09-20T15:19:00.000Z | 2022-03-31T23:52:05.000Z | scripts/automation/trex_control_plane/unit_tests/sock.py | angelyouyou/trex-core | fddf78584cae285d9298ef23f9f5c8725e16911e | [
"Apache-2.0"
] | 429 | 2015-06-27T19:34:21.000Z | 2022-03-23T11:02:51.000Z | #!/usr/bin/python
import os
import socket
import sys
import argparse
import outer_packages
from scapy.all import *
import texttable
class sock_driver(object):
args = None;
cap_server_port = None
proto = None
def fail(msg):
print('\nError: %s\n' % msg)
sys.exit(1)
class CPcapFileReader:
def _... | 36.357401 | 181 | 0.533611 |
798446ab8dc3ed535973059a39fae0a7c27a0afc | 1,253 | py | Python | src/oscarapicheckout/handlers.py | Balu-Varanasi/django-oscar-api-checkout | 7a36bf236ebe91b562dc4afdc0e65afd74bdb43d | [
"0BSD"
] | null | null | null | src/oscarapicheckout/handlers.py | Balu-Varanasi/django-oscar-api-checkout | 7a36bf236ebe91b562dc4afdc0e65afd74bdb43d | [
"0BSD"
] | null | null | null | src/oscarapicheckout/handlers.py | Balu-Varanasi/django-oscar-api-checkout | 7a36bf236ebe91b562dc4afdc0e65afd74bdb43d | [
"0BSD"
] | null | null | null | from django.dispatch import receiver
from oscar.core.loading import get_class
from .email import OrderMessageSender
from .settings import ORDER_PLACED_COMMUNICATION_TYPE_CODE, ORDER_STATUS_PAYMENT_DECLINED
from .signals import order_payment_authorized
import logging
logger = logging.getLogger(__name__)
order_status_c... | 33.864865 | 118 | 0.772546 |
798446c2dea34f603d0e5f5752e345cfe745817e | 23,769 | py | Python | perf.py | JStephenJ-intel/ispc | 44932016daa596a6983e3324379a86980eee33ba | [
"BSD-3-Clause"
] | 1 | 2019-02-19T21:21:01.000Z | 2019-02-19T21:21:01.000Z | perf.py | JStephenJ-intel/ispc | 44932016daa596a6983e3324379a86980eee33ba | [
"BSD-3-Clause"
] | null | null | null | perf.py | JStephenJ-intel/ispc | 44932016daa596a6983e3324379a86980eee33ba | [
"BSD-3-Clause"
] | 1 | 2019-10-02T02:38:58.000Z | 2019-10-02T02:38:58.000Z | #!/usr/bin/python
#
# Copyright (c) 2013, Intel Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# ... | 40.981034 | 187 | 0.561193 |
798446e8997b996d010c086343eeaf7a71bb222c | 2,614 | py | Python | setup.py | rberrelleza/chaostoolkit-kubernetes | cb77bc13cfae866fda9a015873ce0430e4cb0b6a | [
"Apache-2.0"
] | null | null | null | setup.py | rberrelleza/chaostoolkit-kubernetes | cb77bc13cfae866fda9a015873ce0430e4cb0b6a | [
"Apache-2.0"
] | null | null | null | setup.py | rberrelleza/chaostoolkit-kubernetes | cb77bc13cfae866fda9a015873ce0430e4cb0b6a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""chaostoolkit builder and installer"""
import os
import sys
import io
import setuptools
def get_version_from_package() -> str:
"""
Read the package version from the source without importing it.
"""
path = os.path.join(os.path.dirname(__file__), "chaosk8s/__init__.py")
path... | 29.370787 | 74 | 0.671002 |
79844874fec9d08e827ed9a57ea187374c78b0e1 | 7,530 | py | Python | tests/manual/iosched.py | bigo-sg/seastar | 64a9499ee01c66f19dc45a9cd4f0d84c45eb1b7d | [
"Apache-2.0"
] | 6,526 | 2015-09-22T16:47:59.000Z | 2022-03-31T07:31:07.000Z | tests/manual/iosched.py | bigo-sg/seastar | 64a9499ee01c66f19dc45a9cd4f0d84c45eb1b7d | [
"Apache-2.0"
] | 925 | 2015-09-23T13:52:53.000Z | 2022-03-31T21:33:25.000Z | tests/manual/iosched.py | bigo-sg/seastar | 64a9499ee01c66f19dc45a9cd4f0d84c45eb1b7d | [
"Apache-2.0"
] | 1,473 | 2015-09-22T23:19:04.000Z | 2022-03-31T21:09:00.000Z | #!/bin/env python3
import os.path
import yaml
import shutil
import subprocess
import argparse
from functools import reduce
# Default task-quota-ms is 0.5ms
# IO subsystem sets its latency goal to 1.5 of the above
# Test adds 5% to compensate for potential glitches
default_latency_goal = 0.5 * 1.5 * 1.05 / 1000
parse... | 34.227273 | 230 | 0.631076 |
798448768eab150bad2ab5e1b3b4af73981ed96c | 308 | gyp | Python | Dependencies/gyp-master/test/errors/file_cycle1.gyp | knight666/exlibris | b21b46e0c84e5c4f81f8048022cda88e7bb3dca2 | [
"MIT"
] | null | null | null | Dependencies/gyp-master/test/errors/file_cycle1.gyp | knight666/exlibris | b21b46e0c84e5c4f81f8048022cda88e7bb3dca2 | [
"MIT"
] | null | null | null | Dependencies/gyp-master/test/errors/file_cycle1.gyp | knight666/exlibris | b21b46e0c84e5c4f81f8048022cda88e7bb3dca2 | [
"MIT"
] | null | null | null | # Copyright 2014 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'targets': [
{
'target_name': 'middle',
'type': 'none',
'dependencies': [ 'file_cycle0.gyp:bottom' ],
},
],
}
| 22 | 73 | 0.584416 |
79844896265c3a9f6fe24b0582422e875b69a74b | 403 | py | Python | api/migrations/0026_alter_talkroom_id.py | mayone-du/harusmile-backend | 4f6b90ab5c2278401ee50aa54920709effd7f323 | [
"MIT"
] | null | null | null | api/migrations/0026_alter_talkroom_id.py | mayone-du/harusmile-backend | 4f6b90ab5c2278401ee50aa54920709effd7f323 | [
"MIT"
] | 1 | 2021-06-23T09:15:50.000Z | 2021-06-23T09:15:50.000Z | api/migrations/0026_alter_talkroom_id.py | mayone-du/harusmile-backend | 4f6b90ab5c2278401ee50aa54920709effd7f323 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.3 on 2021-06-11 09:49
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0025_auto_20210611_1824'),
]
operations = [
migrations.AlterField(
model_name='talkroom',
name='id',
... | 21.210526 | 73 | 0.60794 |
798449ea9e593cc498d247271b21202620b13814 | 6,488 | py | Python | medcat/deprecated/cat_ann.py | louni-g/MedCAT | 5ffa96b9cef2520ab3a4b406aa2ab880b38f1e13 | [
"MIT"
] | 1 | 2021-07-09T03:18:56.000Z | 2021-07-09T03:18:56.000Z | medcat/deprecated/cat_ann.py | louni-g/MedCAT | 5ffa96b9cef2520ab3a4b406aa2ab880b38f1e13 | [
"MIT"
] | 16 | 2021-11-25T08:09:04.000Z | 2022-03-22T01:28:54.000Z | medcat/deprecated/cat_ann.py | louni-g/MedCAT | 5ffa96b9cef2520ab3a4b406aa2ab880b38f1e13 | [
"MIT"
] | 1 | 2021-07-09T03:18:58.000Z | 2021-07-09T03:18:58.000Z | """ I would just ignore this whole class, it's just a lot of rules that work nicely for UMLS with garbage
once the software is trained the main thing are the context vectors.
"""
import numpy as np
import operator
class CatAnn(object):
def __init__(self, cdb, spacy_cat):
self.cdb = cdb
self._cat =... | 41.324841 | 117 | 0.445284 |
79844a29a9e93ddb49ce5d44b711d58f9d0f15f4 | 7,424 | py | Python | simulation/python_standard_lib/importlib/resources.py | john-grando/pyExpandObjects | c08b1d1bc45684bc71c0f49b4d2f22c707cd4aa4 | [
"BSD-3-Clause"
] | 1 | 2021-01-09T14:48:12.000Z | 2021-01-09T14:48:12.000Z | simulation/python_standard_lib/importlib/resources.py | john-grando/pyExpandObjects | c08b1d1bc45684bc71c0f49b4d2f22c707cd4aa4 | [
"BSD-3-Clause"
] | 1 | 2021-02-03T01:56:56.000Z | 2021-02-03T01:56:56.000Z | my-electron-app/src/components/python_terminal/python/Lib/importlib/resources.py | diesisfox/ECE496 | 9864bfe2426d1f7e94776f63e3e477f37798754f | [
"MIT"
] | 1 | 2022-01-11T18:31:05.000Z | 2022-01-11T18:31:05.000Z | import os
from . import abc as resources_abc
from . import _common
from ._common import as_file
from contextlib import contextmanager, suppress
from importlib import import_module
from importlib.abc import ResourceLoader
from io import BytesIO, TextIOWrapper
from pathlib import Path
from types import ModuleT... | 34.37037 | 79 | 0.665544 |
79844a642d82f348e0b5a79d5d001c6bcf568ecf | 4,688 | py | Python | kubernetes/client/models/v1alpha1_initializer.py | Scalr/kubernetes-client-python | 07442bdb76f0876ec96c0b0da6f9c4b06d7e5e38 | [
"Apache-2.0"
] | 3 | 2019-05-19T05:05:37.000Z | 2020-03-20T04:56:20.000Z | kubernetes/client/models/v1alpha1_initializer.py | Scalr/kubernetes-client-python | 07442bdb76f0876ec96c0b0da6f9c4b06d7e5e38 | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/v1alpha1_initializer.py | Scalr/kubernetes-client-python | 07442bdb76f0876ec96c0b0da6f9c4b06d7e5e38 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.13.5
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re... | 30.051282 | 296 | 0.59087 |
79844ae60c85aafea8e652697f20856604b78fc3 | 3,769 | py | Python | libnum/modular.py | hellman/libnum | d90dc9ec5769bcadd483f98f0c71b587ceeb80f0 | [
"MIT"
] | 222 | 2015-01-24T10:59:22.000Z | 2022-03-29T12:04:10.000Z | libnum/modular.py | hellman/libnum | d90dc9ec5769bcadd483f98f0c71b587ceeb80f0 | [
"MIT"
] | 5 | 2018-02-14T22:55:11.000Z | 2020-09-29T10:56:08.000Z | libnum/modular.py | hellman/libnum | d90dc9ec5769bcadd483f98f0c71b587ceeb80f0 | [
"MIT"
] | 59 | 2015-02-19T10:30:45.000Z | 2021-11-15T04:53:13.000Z | import operator
from functools import reduce
from .common import gcd, xgcd
from .stuff import factorial_get_prime_pow, factorial
def has_invmod(a, modulus):
"""
Check if @a can be inversed under @modulus.
Call this before calling invmod.
"""
if modulus < 2:
raise ValueError("modulus must... | 23.704403 | 74 | 0.517909 |
79844bfd0320f986de51b51825809b34064b0113 | 170 | py | Python | python/Strings/capitalize.py | cdrowley/hackerrank | cc5c925327cd3ce5b52c1614b814da75d42cca72 | [
"MIT"
] | null | null | null | python/Strings/capitalize.py | cdrowley/hackerrank | cc5c925327cd3ce5b52c1614b814da75d42cca72 | [
"MIT"
] | null | null | null | python/Strings/capitalize.py | cdrowley/hackerrank | cc5c925327cd3ce5b52c1614b814da75d42cca72 | [
"MIT"
] | null | null | null | # https://www.hackerrank.com/challenges/capitalize/problem
def solve(full_name):
cap_name = " ".join(map(str.capitalize, full_name.split(" ")))
return cap_name
| 24.285714 | 66 | 0.711765 |
79844ca9bef0f528e45bf31da4fd7dbea2d4f14a | 667 | py | Python | spirl/configs/hrl/kitchen/spirl/conf.py | kouroshHakha/fist | 328c098789239fd892e17edefd799fc1957ab637 | [
"BSD-3-Clause"
] | 8 | 2021-10-14T03:14:23.000Z | 2022-03-15T21:31:17.000Z | spirl/configs/hrl/kitchen/spirl/conf.py | kouroshHakha/fist | 328c098789239fd892e17edefd799fc1957ab637 | [
"BSD-3-Clause"
] | null | null | null | spirl/configs/hrl/kitchen/spirl/conf.py | kouroshHakha/fist | 328c098789239fd892e17edefd799fc1957ab637 | [
"BSD-3-Clause"
] | 1 | 2021-09-13T20:42:28.000Z | 2021-09-13T20:42:28.000Z | from spirl.configs.hrl.kitchen.base_conf import *
from spirl.rl.policies.prior_policies import LearnedPriorAugmentedPIPolicy
from spirl.rl.agents.prior_sac_agent import ActionPriorSACAgent
# update policy to use prior model for computing divergence
hl_policy_params.update(AttrDict(
prior_model=ll_agent_config.mod... | 35.105263 | 74 | 0.842579 |
79844e14858cb3f938f2e8ccfc73ee0e839fb503 | 1,945 | py | Python | graphing/training_time_vs_tsr.py | harry-uglow/Curriculum-Reinforcement-Learning | cb050556e1fdc7b7de8d63ad932fc712a35ac144 | [
"MIT"
] | 15 | 2020-02-02T22:22:41.000Z | 2022-03-03T07:50:45.000Z | graphing/training_time_vs_tsr.py | harry-uglow/Deep-RL-Sim2Real | cb050556e1fdc7b7de8d63ad932fc712a35ac144 | [
"MIT"
] | 8 | 2020-01-28T20:45:54.000Z | 2022-03-14T07:58:27.000Z | graphing/training_time_vs_tsr.py | harry-uglow/Curriculum-Reinforcement-Learning | cb050556e1fdc7b7de8d63ad932fc712a35ac144 | [
"MIT"
] | 5 | 2020-03-26T15:46:51.000Z | 2022-01-17T09:48:02.000Z | import numpy as np
import torch
import matplotlib.pyplot as plt
import seaborn as sns
# two_stage_baseline_data = [torch.load(f"sparse_dr_{i}M_eval.pt") for i in range(1, 5)]
# curl_data = torch.load(f"curl_eval.pt")
# dense_dr_data = torch.load(f"dense_dr_eval.pt")
clrs = [
'#1f77b4', # muted blue
'#ff7f0e',... | 27.394366 | 88 | 0.554242 |
79844ee005f9ec5c47a32c088647152493e3784a | 696 | py | Python | mi/dataset/driver/moas/gl/dosta/dosta_abcdjm_glider_telemetered_driver.py | petercable/mi-dataset | d3c1607ea31af85fbba5719a31d4a60bf39f8dd3 | [
"BSD-2-Clause"
] | 1 | 2015-05-10T01:08:44.000Z | 2015-05-10T01:08:44.000Z | mi/dataset/driver/moas/gl/dosta/dosta_abcdjm_glider_telemetered_driver.py | petercable/mi-dataset | d3c1607ea31af85fbba5719a31d4a60bf39f8dd3 | [
"BSD-2-Clause"
] | null | null | null | mi/dataset/driver/moas/gl/dosta/dosta_abcdjm_glider_telemetered_driver.py | petercable/mi-dataset | d3c1607ea31af85fbba5719a31d4a60bf39f8dd3 | [
"BSD-2-Clause"
] | 9 | 2015-04-15T21:09:08.000Z | 2019-11-15T03:18:53.000Z | ##
# OOIPLACEHOLDER
#
# Copyright 2014 Raytheon Co.
##
__author__ = "mworden"
import os
from mi.logging import config
from mi.dataset.driver.moas.gl.dosta.driver_common import DostaAbcdjmGliderDriver
from mi.dataset.dataset_parser import DataSetDriverConfigKeys
from mi.core.versioning import version
@version("1... | 23.2 | 92 | 0.783046 |
79844fd7704281f15a4d1e07bc62159ff3b850e9 | 6,340 | py | Python | test/coredotfinance/test_data.py | DavidKimDY/Test-codecov-cdf | 536a59d1434926447010f3736a5c4519eb713003 | [
"Apache-2.0"
] | 7 | 2021-07-03T05:35:38.000Z | 2022-02-28T03:51:41.000Z | test/coredotfinance/test_data.py | CoreDotToday/coredotfinance | 836f2065eb269775ae95ac20d0016632c5864b86 | [
"Apache-2.0"
] | 31 | 2021-05-03T06:53:12.000Z | 2021-10-22T03:29:25.000Z | test/coredotfinance/test_data.py | DavidKimDY/Test-codecov-cdf | 536a59d1434926447010f3736a5c4519eb713003 | [
"Apache-2.0"
] | 3 | 2021-05-03T04:05:34.000Z | 2021-05-03T07:01:48.000Z | import pytest
from datetime import datetime, timedelta
from coredotfinance.data import BinanceReader, KrxReader
binance = BinanceReader()
krx = KrxReader()
# ---------------------------- krx -----------------------------------
# ---------------------------- krx read -----------------------------------
# read
def ... | 27.2103 | 88 | 0.597792 |
798450958ef1c276582b9b13859bdd6480305de3 | 2,004 | py | Python | src/inverse_text_normalization/te/taggers/ordinal.py | yashiagar1999/indict_punc | 8697ac5a5245c7e0d35b0777b1dc6fb1b8d6d525 | [
"MIT"
] | 15 | 2021-07-30T18:18:47.000Z | 2022-02-14T09:04:19.000Z | src/inverse_text_normalization/te/taggers/ordinal.py | yashiagar1999/indict_punc | 8697ac5a5245c7e0d35b0777b1dc6fb1b8d6d525 | [
"MIT"
] | 1 | 2021-12-15T12:42:12.000Z | 2022-02-15T05:33:00.000Z | src/inverse_text_normalization/te/taggers/ordinal.py | yashiagar1999/indict_punc | 8697ac5a5245c7e0d35b0777b1dc6fb1b8d6d525 | [
"MIT"
] | 4 | 2021-07-30T10:03:38.000Z | 2021-12-01T14:46:54.000Z | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 36.436364 | 89 | 0.717565 |
79845276c1a5db0f3f8e62ccfda371c4c76a9390 | 1,022 | py | Python | Lista6/Erros.py | thiago9864/calculo_numerico | e4b6f059bdb31460130093bd446fb3ea906dc542 | [
"MIT"
] | null | null | null | Lista6/Erros.py | thiago9864/calculo_numerico | e4b6f059bdb31460130093bd446fb3ea906dc542 | [
"MIT"
] | null | null | null | Lista6/Erros.py | thiago9864/calculo_numerico | e4b6f059bdb31460130093bd446fb3ea906dc542 | [
"MIT"
] | 1 | 2018-08-25T14:30:48.000Z | 2018-08-25T14:30:48.000Z | # -*- coding: utf-8 -*-
"""
@author: Renan, Thiago
"""
#Calculo do Erro
import numpy as np
from MetodosIntegracao import NewtonCotes
from MinimosQuadrados import MinimosQuadrados
class Erro():
def erroDaNorma(self,K,a,b,f,coeficientes, n, particoes): #1
#K = Numero de Particoes
#a = interval... | 22.217391 | 80 | 0.569472 |
7984528275fa13628eb3d1335a3be0bd07c04a03 | 21,272 | py | Python | tests/training/test_plugins.py | vishalbelsare/avalanche | 128491b5712ffac826fe30eb798cd22ae147396b | [
"MIT"
] | null | null | null | tests/training/test_plugins.py | vishalbelsare/avalanche | 128491b5712ffac826fe30eb798cd22ae147396b | [
"MIT"
] | null | null | null | tests/training/test_plugins.py | vishalbelsare/avalanche | 128491b5712ffac826fe30eb798cd22ae147396b | [
"MIT"
] | null | null | null | import itertools
import sys
import torch
from torch import nn
import unittest
from sklearn.datasets import make_classification
from sklearn.model_selection import train_test_split
from torch.nn import CrossEntropyLoss
from torch.optim import SGD
from torch.optim.lr_scheduler import MultiStepLR, ReduceLROnPlateau
from... | 38.121864 | 79 | 0.56478 |
7984532066fc99a305da505d91e84625d6258bfd | 1,517 | py | Python | tutorial_1/1_range.py | chene5/Big-Data-in-Psychology | c6c48475d7c491aec6f80c7cc26bd59d8dc932b0 | [
"MIT"
] | null | null | null | tutorial_1/1_range.py | chene5/Big-Data-in-Psychology | c6c48475d7c491aec6f80c7cc26bd59d8dc932b0 | [
"MIT"
] | null | null | null | tutorial_1/1_range.py | chene5/Big-Data-in-Psychology | c6c48475d7c491aec6f80c7cc26bd59d8dc932b0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""1_range.py
Example code for requesting data via the U.S. Government Printing Office
(GPO) API.
Created on Sun Feb 14 10:30:23 2016
Dates take the form:
Year-Month-Date
2005-02-14
@author: Eric Chen
"""
from datetime import datetime, timedelta
from time import sleep
import urllib2
# Set u... | 28.092593 | 72 | 0.678972 |
798453e212010384ff3266c5627d4d98bcd18458 | 202 | py | Python | Conteudo das Aulas/130/hello_thread.py | cerberus707/lab-python | ebba3c9cde873d70d4bb61084f79ce30b7f9e047 | [
"Apache-2.0"
] | null | null | null | Conteudo das Aulas/130/hello_thread.py | cerberus707/lab-python | ebba3c9cde873d70d4bb61084f79ce30b7f9e047 | [
"Apache-2.0"
] | null | null | null | Conteudo das Aulas/130/hello_thread.py | cerberus707/lab-python | ebba3c9cde873d70d4bb61084f79ce30b7f9e047 | [
"Apache-2.0"
] | null | null | null | import _thread
def filho(tid):
print('Ola da thread', tid)
def pai():
i = 0
while True:
i += 1
_thread.start_new_thread(filho, (i,))
if input() == 'q': break
pai()
| 15.538462 | 45 | 0.529703 |
7984540ff70ca32ee2cbf00fcbbbcb8ed68f3320 | 2,598 | py | Python | datalabeling/label_image.py | nilold/python-docs-samples | a6405189fc47dd41b90c185061293105eebd8a94 | [
"Apache-2.0"
] | 3 | 2021-01-24T23:42:57.000Z | 2021-02-17T12:02:12.000Z | datalabeling/label_image.py | nilold/python-docs-samples | a6405189fc47dd41b90c185061293105eebd8a94 | [
"Apache-2.0"
] | 320 | 2020-11-08T21:02:43.000Z | 2022-02-10T10:43:29.000Z | datalabeling/label_image.py | nilold/python-docs-samples | a6405189fc47dd41b90c185061293105eebd8a94 | [
"Apache-2.0"
] | 2 | 2019-11-04T18:25:20.000Z | 2019-11-05T14:35:28.000Z | #!/usr/bin/env python
# Copyright 2019 Google LLC
#
# 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... | 30.209302 | 77 | 0.718245 |
7984549c133a279dacfae1d7c69d84b35108f7ed | 30,376 | py | Python | env/Lib/site-packages/plotly/express/_doc.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 7 | 2022-01-16T12:28:16.000Z | 2022-03-04T15:31:45.000Z | env/Lib/site-packages/plotly/express/_doc.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 14 | 2021-10-20T23:33:47.000Z | 2021-12-21T04:50:37.000Z | env/Lib/site-packages/plotly/express/_doc.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | null | null | null | import inspect
from textwrap import TextWrapper
try:
getfullargspec = inspect.getfullargspec
except AttributeError: # python 2
getfullargspec = inspect.getargspec
colref_type = "str or int or Series or array-like"
colref_desc = "Either a name of a column in `data_frame`, or a pandas Series or array_like obj... | 48.523962 | 413 | 0.636061 |
798455687896e9ccc35b88cd58afe2dd20e50004 | 4,617 | py | Python | webStorm-APICloud/python_tools/Lib/test/test_gzip.py | zzr925028429/androidyianyan | 8967fdba92473e8e65ee222515dfc54cdae5bb0b | [
"MIT"
] | 81 | 2017-03-13T08:24:01.000Z | 2021-04-02T09:48:38.000Z | webStorm-APICloud/python_tools/Lib/test/test_gzip.py | zzr925028429/androidyianyan | 8967fdba92473e8e65ee222515dfc54cdae5bb0b | [
"MIT"
] | 6 | 2017-04-30T08:36:55.000Z | 2017-09-22T01:37:28.000Z | webStorm-APICloud/python_tools/Lib/test/test_gzip.py | zzr925028429/androidyianyan | 8967fdba92473e8e65ee222515dfc54cdae5bb0b | [
"MIT"
] | 41 | 2017-03-18T14:11:58.000Z | 2021-04-14T05:06:09.000Z | #! /usr/bin/env python
"""Test script for the gzip module.
"""
import unittest
from test import test_support
import os
import gzip
data1 = """ int length=DEFAULTALLOC, err = Z_OK;
PyObject *RetVal;
int flushmode = Z_FINISH;
unsigned long start_total_out;
"""
data2 = """/* zlibmodule.c -- gz... | 27.482143 | 81 | 0.524583 |
798455bcec55d89ced5d95f0bfc614ff8155713e | 202 | py | Python | src/violinplots/violin.py | Ellon-M/visualizations | 5a42c213ea8fd0597e2035778d9ae6460eb9e821 | [
"MIT"
] | null | null | null | src/violinplots/violin.py | Ellon-M/visualizations | 5a42c213ea8fd0597e2035778d9ae6460eb9e821 | [
"MIT"
] | null | null | null | src/violinplots/violin.py | Ellon-M/visualizations | 5a42c213ea8fd0597e2035778d9ae6460eb9e821 | [
"MIT"
] | null | null | null | ### violin
import plotly.express as px
df = px.data.tips()
fig = px.violin(df, y="tip", x="smoker", color="sex", box=True, points="all",
hover_data=df.columns, template="gridon")
fig.show()
| 22.444444 | 77 | 0.638614 |
798456f307271786685bf0e63c48654c6cbe5f20 | 2,126 | py | Python | examples/learning_rate_finder.py | LorePep/deepyeast | 4f35276b8d3a9ae03a14105c84b0746431fbf409 | [
"MIT"
] | null | null | null | examples/learning_rate_finder.py | LorePep/deepyeast | 4f35276b8d3a9ae03a14105c84b0746431fbf409 | [
"MIT"
] | null | null | null | examples/learning_rate_finder.py | LorePep/deepyeast | 4f35276b8d3a9ae03a14105c84b0746431fbf409 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import keras
from keras import backend as K
from keras.preprocessing.image import ImageDataGenerator
from deepyeast.dataset import load_data
from deepyeast.utils import preprocess_input
from deepyeast.models import DeepYeast
class LearningRateFinder:
def __init__... | 29.527778 | 91 | 0.611947 |
7984577d06ebce9cdca4e9f7b7e984758c121d19 | 239 | py | Python | src/bisip/tests/__init__.py | clberube/BISIP | b52620b66ca1533b23a94e3efe1ad0d59e1508b8 | [
"MIT"
] | 9 | 2017-04-21T20:17:05.000Z | 2021-12-03T07:06:02.000Z | src/bisip/tests/__init__.py | clberube/BISIP | b52620b66ca1533b23a94e3efe1ad0d59e1508b8 | [
"MIT"
] | 4 | 2017-09-28T07:06:56.000Z | 2019-08-24T18:36:25.000Z | src/bisip/tests/__init__.py | clberube/BISIP | b52620b66ca1533b23a94e3efe1ad0d59e1508b8 | [
"MIT"
] | 2 | 2018-03-05T14:52:32.000Z | 2018-03-26T14:19:33.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: charles
# @Date: 2021-01-11 09:01:52
# @Last modified by: charles
# @Last modified time: 2021-01-11 09:01:93
from .test_module import test_run
__all__ = (
'test_run',
)
| 14.9375 | 42 | 0.631799 |
7984578eff57b31c123a57b855a70c492d69576b | 1,145 | py | Python | python/origen/origen/errors.py | Origen-SDK/o2 | 5b0f9a6d113ddebc73c7ee224931e8b2d0301794 | [
"MIT"
] | null | null | null | python/origen/origen/errors.py | Origen-SDK/o2 | 5b0f9a6d113ddebc73c7ee224931e8b2d0301794 | [
"MIT"
] | 127 | 2019-11-23T17:09:35.000Z | 2021-09-02T11:06:20.000Z | python/origen/origen/errors.py | Origen-SDK/o2 | 5b0f9a6d113ddebc73c7ee224931e8b2d0301794 | [
"MIT"
] | null | null | null | class DuplicateInstanceError(Exception):
def __init__(self, obj, klass_alias=None):
klass = str(obj.__class__).split(
"'")[1] if klass_alias is None else klass_alias
if isinstance(klass, str):
if 'name' in dir(obj):
Exception.__init__(
self... | 35.78125 | 97 | 0.537991 |
798458ee48d32aad402d7209ed8fef289c6d9090 | 146 | py | Python | 1-beginner/1042.py | alenvieira/uri-online-judge-solutions | ca5ae7064d84af4dae12fc37d4d14ee441e49d06 | [
"MIT"
] | null | null | null | 1-beginner/1042.py | alenvieira/uri-online-judge-solutions | ca5ae7064d84af4dae12fc37d4d14ee441e49d06 | [
"MIT"
] | null | null | null | 1-beginner/1042.py | alenvieira/uri-online-judge-solutions | ca5ae7064d84af4dae12fc37d4d14ee441e49d06 | [
"MIT"
] | null | null | null | values = [int(value) for value in input().split(' ')]
for value in sorted(values):
print(value)
print()
for value in values:
print(value)
| 20.857143 | 53 | 0.664384 |
798459cda4d5242c6ea9ec82d74a7962a6ad826f | 213 | py | Python | tests/adhoc/test_shared_config_base_url.py | dunossauro/selene | 51766d5e0e3edcc43593087eb480ab7c7f7aff80 | [
"MIT"
] | null | null | null | tests/adhoc/test_shared_config_base_url.py | dunossauro/selene | 51766d5e0e3edcc43593087eb480ab7c7f7aff80 | [
"MIT"
] | null | null | null | tests/adhoc/test_shared_config_base_url.py | dunossauro/selene | 51766d5e0e3edcc43593087eb480ab7c7f7aff80 | [
"MIT"
] | null | null | null | from selene import browser, be, config
def test_opening_relative_url():
config.base_url = 'http://todomvc.com/examples/emberjs'
browser.open_url('/')
browser.element('#new-todo').should(be.visible)
| 23.666667 | 59 | 0.71831 |
79845a10118f4ec1b51aefd0b1befeef130f6f79 | 4,719 | py | Python | samtranslator/model/role_utils/role_constructor.py | kavindasr/serverless-application-model | 016646db01fcf2283a82446b49677fe94925dd27 | [
"Apache-2.0",
"MIT"
] | null | null | null | samtranslator/model/role_utils/role_constructor.py | kavindasr/serverless-application-model | 016646db01fcf2283a82446b49677fe94925dd27 | [
"Apache-2.0",
"MIT"
] | 1 | 2020-03-03T01:46:46.000Z | 2020-03-03T01:46:46.000Z | samtranslator/model/role_utils/role_constructor.py | kavindasr/serverless-application-model | 016646db01fcf2283a82446b49677fe94925dd27 | [
"Apache-2.0",
"MIT"
] | null | null | null | from samtranslator.model.iam import IAMRole
from samtranslator.model.resource_policies import ResourcePolicies, PolicyTypes
from samtranslator.model.intrinsics import is_intrinsic_if, is_intrinsic_no_value
from samtranslator.model.exceptions import InvalidResourceException
def construct_role_for_resource(
resourc... | 42.9 | 110 | 0.657555 |
79845a7d5798e7e4157759684476f6afd2c2380a | 2,874 | py | Python | IO_helper.py | begab/mamus | 94005a809fd8b547c2054d51adf117b8646035ed | [
"MIT"
] | 13 | 2020-01-12T22:06:41.000Z | 2021-09-28T14:23:37.000Z | IO_helper.py | begab/mamus | 94005a809fd8b547c2054d51adf117b8646035ed | [
"MIT"
] | null | null | null | IO_helper.py | begab/mamus | 94005a809fd8b547c2054d51adf117b8646035ed | [
"MIT"
] | 1 | 2020-07-23T02:31:43.000Z | 2020-07-23T02:31:43.000Z | import re
import gzip
import numpy as np
from zipfile import ZipFile
def load_corpus(corpus_file, load_tags=False):
if corpus_file.endswith('.gz'):
corpus = []
with gzip.open(corpus_file, 'r') as f:
for line in f:
corpus.append(line.decode("utf-8").split())
elif cor... | 38.837838 | 134 | 0.565414 |
79845a9ab401c225179b0b9fb4e76cbd8ba57350 | 2,730 | py | Python | test/test_day15.py | daniel-stockhausen/adventofcode2021 | e21969a9bf6fe3e9d520cf36dc34de02e24dd0d2 | [
"MIT"
] | null | null | null | test/test_day15.py | daniel-stockhausen/adventofcode2021 | e21969a9bf6fe3e9d520cf36dc34de02e24dd0d2 | [
"MIT"
] | null | null | null | test/test_day15.py | daniel-stockhausen/adventofcode2021 | e21969a9bf6fe3e9d520cf36dc34de02e24dd0d2 | [
"MIT"
] | null | null | null | import os
import unittest
from aoc.day15.day15 import calc_lowest_route_risk, get_example_data, get_input_data, tile_riskmap
class TestDay15(unittest.TestCase):
def test_15a_example(self):
self.assertEqual(40, calc_lowest_route_risk(get_example_data()))
def test_15a(self):
self.assertEqual(7... | 47.894737 | 98 | 0.482784 |
79845b8393d62939d43163276572b598ab401a13 | 889 | py | Python | trabalho-avaliado-2-bimestre/database/dao/usuariodao.py | lucasdefelippe/ds2 | ede67b1d9fa0c9b4b6bcc358eab1bff35ba74a22 | [
"MIT"
] | null | null | null | trabalho-avaliado-2-bimestre/database/dao/usuariodao.py | lucasdefelippe/ds2 | ede67b1d9fa0c9b4b6bcc358eab1bff35ba74a22 | [
"MIT"
] | null | null | null | trabalho-avaliado-2-bimestre/database/dao/usuariodao.py | lucasdefelippe/ds2 | ede67b1d9fa0c9b4b6bcc358eab1bff35ba74a22 | [
"MIT"
] | null | null | null | import sys
sys.path.append('../model/')
from model.usuario import Usuario
from psycopg2 import connect
from dao.dao import DAO
class UsuarioDao(DAO):
def __init__(self):
super().__init__()
def buscar(self, usuario):
try:
with connect(self._dados_con) as conn:
cu... | 34.192308 | 123 | 0.524184 |
79845baf5b9ce7d753b132c6153ff5aca34c2066 | 1,200 | py | Python | app/helper/feed.py | VikTymZ/pegelinux | bd274aebf8606da5217e0ee7653cf0dd8db4c10a | [
"MIT"
] | 11 | 2018-06-29T01:48:05.000Z | 2021-01-13T19:56:02.000Z | app/helper/feed.py | VikTymZ/pegelinux | bd274aebf8606da5217e0ee7653cf0dd8db4c10a | [
"MIT"
] | 237 | 2018-07-01T05:18:03.000Z | 2022-02-12T10:32:50.000Z | app/helper/feed.py | VikTymZ/pegelinux | bd274aebf8606da5217e0ee7653cf0dd8db4c10a | [
"MIT"
] | 9 | 2018-06-30T12:10:28.000Z | 2019-10-22T10:42:43.000Z | import feedparser
import datetime
from app import db
from app.models.post import Post
from app.models.feed import Feed, APPROVED
def get_feed(url):
try:
feeds = feedparser.parse(url)
return feeds.get('status'), feeds.entries
except Exception as e:
msg = f'Error {e} occured'... | 28.571429 | 71 | 0.586667 |
79845c5e6121adc4504b0c04231448403dbb2739 | 1,035 | py | Python | test/test_contact_add.py | IKeiran/FPT-Sinyakov | 08c5121d84c394bcee91d087ac2d14581179d2fd | [
"Apache-2.0"
] | null | null | null | test/test_contact_add.py | IKeiran/FPT-Sinyakov | 08c5121d84c394bcee91d087ac2d14581179d2fd | [
"Apache-2.0"
] | null | null | null | test/test_contact_add.py | IKeiran/FPT-Sinyakov | 08c5121d84c394bcee91d087ac2d14581179d2fd | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from model.contact import Contact
import pytest
b_button = [True, False]
@pytest.mark.parametrize('bottom_button', b_button, ids=[repr(x) for x in b_button])
def test_contact_add(app, db, check_ui, bottom_button, json_contact):
app.go_to_main_page()
with pytest.allure.step('Given a co... | 47.045455 | 129 | 0.715942 |
79845c98bff777418c9d43f81219cbf2a459244d | 449 | py | Python | app/models/group.py | KrusnikViers/zordon | 585dca256255ceb94f99dc5b221176e59ff511cf | [
"MIT"
] | 2 | 2017-07-16T10:35:57.000Z | 2019-02-13T13:50:41.000Z | app/models/group.py | IlyaDobrynin/Zordon | 1252f107995a48108cc2dbd8710013747128239a | [
"MIT"
] | 73 | 2017-07-05T08:53:27.000Z | 2020-07-07T17:11:18.000Z | app/models/group.py | IlyaDobrynin/Zordon | 1252f107995a48108cc2dbd8710013747128239a | [
"MIT"
] | 2 | 2018-11-28T12:55:58.000Z | 2019-02-13T14:07:06.000Z | from sqlalchemy import BigInteger, Column, String
from sqlalchemy.orm import relationship
from app.database.base_model import Base
from app.models.relationships import group_members
class Group(Base):
__tablename__ = 'groups'
id = Column(BigInteger, primary_key=True)
name = Column(String, nullable=False... | 28.0625 | 82 | 0.768374 |
79845d981288f85f451027d0b502849b0b91fd19 | 5,217 | py | Python | tests/unit/server_tests/test_service_info_handler.py | Bensonaa/TabPy | 17aa74253f2a1d64a346b86f5dc6cb8f44b4ff4b | [
"MIT"
] | 1 | 2021-06-15T19:56:24.000Z | 2021-06-15T19:56:24.000Z | tests/unit/server_tests/test_service_info_handler.py | Bensonaa/TabPy | 17aa74253f2a1d64a346b86f5dc6cb8f44b4ff4b | [
"MIT"
] | 1 | 2021-03-21T00:04:52.000Z | 2021-03-21T00:04:52.000Z | tests/unit/server_tests/test_service_info_handler.py | Bensonaa/TabPy | 17aa74253f2a1d64a346b86f5dc6cb8f44b4ff4b | [
"MIT"
] | 1 | 2021-08-20T06:40:40.000Z | 2021-08-20T06:40:40.000Z | import base64
import json
import os
from tabpy.tabpy_server.app.app import TabPyApp
from tabpy.tabpy_server.app.app_parameters import SettingsParameters
import tempfile
from tornado.testing import AsyncHTTPTestCase
def _create_expected_info_response(settings, tabpy_state):
return {
"description": tabpy_st... | 37 | 91 | 0.632931 |
79845db7339842e8defcf9c626842b3f1b7a72f4 | 36,027 | py | Python | .eggs/pytest-4.4.1-py3.9.egg/_pytest/_code/code.py | deveshkedia/TrafficSignDetectionLibrary | f079b9fa3be032d1e4291e4bea4b0865c7ab72c6 | [
"MIT"
] | 8 | 2019-05-29T09:38:30.000Z | 2021-01-20T03:36:59.000Z | .eggs/pytest-4.4.1-py3.9.egg/_pytest/_code/code.py | deveshkedia/TrafficSignDetectionLibrary | f079b9fa3be032d1e4291e4bea4b0865c7ab72c6 | [
"MIT"
] | 12 | 2021-03-09T03:01:16.000Z | 2022-03-11T23:59:36.000Z | .eggs/pytest-4.4.1-py3.9.egg/_pytest/_code/code.py | deveshkedia/TrafficSignDetectionLibrary | f079b9fa3be032d1e4291e4bea4b0865c7ab72c6 | [
"MIT"
] | 1 | 2020-07-17T12:49:49.000Z | 2020-07-17T12:49:49.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import inspect
import pprint
import re
import sys
import traceback
from inspect import CO_VARARGS
from inspect import CO_VARKEYWORDS
from weakref import ref
import attr
import pluggy
import py
import six
from ... | 33.021998 | 117 | 0.575818 |
79845dbba01bba35b8abf0857531f6a93a10058f | 1,881 | py | Python | app/git.py | rockman/git-dashboard | dec4930dcbeebc2122d9fed25404bada60ec456b | [
"MIT"
] | null | null | null | app/git.py | rockman/git-dashboard | dec4930dcbeebc2122d9fed25404bada60ec456b | [
"MIT"
] | null | null | null | app/git.py | rockman/git-dashboard | dec4930dcbeebc2122d9fed25404bada60ec456b | [
"MIT"
] | null | null | null |
import os
import subprocess
from pathlib import Path
class Repo:
def __init__(self, path):
self.path = path
self.status = None
def get_status(self):
self.status = self._get_status()
return self.status
def _get_status(self):
path = Path(self.path)
if not... | 20.67033 | 64 | 0.616693 |
79845dc5e572c164a9f1399614ac9a94ec5203a7 | 13,522 | py | Python | nova/tests/unit/api/openstack/compute/test_versions.py | venusource/nova | 0c6e6f180eebe71a3431abf726a0fd0c66578162 | [
"Apache-2.0"
] | 7 | 2015-09-22T11:27:16.000Z | 2015-11-02T12:33:46.000Z | nova/tests/unit/api/openstack/compute/test_versions.py | venusource/nova | 0c6e6f180eebe71a3431abf726a0fd0c66578162 | [
"Apache-2.0"
] | 2 | 2015-09-07T22:14:46.000Z | 2020-08-12T08:51:56.000Z | nova/tests/unit/api/openstack/compute/test_versions.py | venusource/nova | 0c6e6f180eebe71a3431abf726a0fd0c66578162 | [
"Apache-2.0"
] | 4 | 2015-09-09T16:48:56.000Z | 2022-03-15T20:52:57.000Z | # Copyright 2010-2011 OpenStack Foundation
# 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... | 32.900243 | 78 | 0.497264 |
79845e2690055070424fbe7c008a2798029d3d02 | 228 | py | Python | {{cookiecutter.role_name}}/molecule/{{cookiecutter.scenario_name}}/tests/test_default.py | datwiz/molecule-azure-role-template | 615fecd72980d5544a7f98b4d5ff14b348421c2a | [
"Apache-2.0"
] | 2 | 2019-10-02T05:27:03.000Z | 2020-11-10T20:36:31.000Z | {{cookiecutter.role_name}}/molecule/{{cookiecutter.scenario_name}}/tests/test_default.py | datwiz/molecule-azure-role-template | 615fecd72980d5544a7f98b4d5ff14b348421c2a | [
"Apache-2.0"
] | null | null | null | {{cookiecutter.role_name}}/molecule/{{cookiecutter.scenario_name}}/tests/test_default.py | datwiz/molecule-azure-role-template | 615fecd72980d5544a7f98b4d5ff14b348421c2a | [
"Apache-2.0"
] | 3 | 2019-03-31T23:16:18.000Z | 2019-10-02T05:33:09.000Z | import pytest
@pytest.mark.parametrize('file', [
('/etc/hosts'),
('/etc/resolv.conf'),
])
def test_files(host, file):
f = host.file(file)
assert f.exists
assert f.user == 'root'
assert f.group == 'root'
| 19 | 34 | 0.596491 |
79845ecc347525ca094a2d2610d84f3862d83b15 | 769 | py | Python | src/app/message/duckduckgo.py | FelisCatusKR/LineBot-FunFeatures | b35d945e1e8e227277c6d3b7fcf270b71aca00a5 | [
"MIT"
] | 1 | 2020-01-18T16:36:06.000Z | 2020-01-18T16:36:06.000Z | src/app/message/duckduckgo.py | FelisCatusKR/LineBot-FunFeatures | b35d945e1e8e227277c6d3b7fcf270b71aca00a5 | [
"MIT"
] | 2 | 2020-01-18T05:03:27.000Z | 2020-01-18T06:46:51.000Z | src/app/message/duckduckgo.py | FelisCatusKR/LineBot-FunFeatures | b35d945e1e8e227277c6d3b7fcf270b71aca00a5 | [
"MIT"
] | 1 | 2020-01-18T04:35:43.000Z | 2020-01-18T04:35:43.000Z | from linebot.models import TextSendMessage, ImageSendMessage
from . import line_bot_api, exception_handler
from app.util.duckduckgo import duckduckgo_image_search
@exception_handler
def send_image_search_message(line_event, args: str):
if args == "":
line_bot_api.reply_message(
line_event.rep... | 33.434783 | 86 | 0.6671 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.