hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
75f12e66c8b17bde07a8b31fa30da8ff59658270 | 26,803 | py | Python | cr101.py | quezadaminter/cr101 | 9461852f3146cef467f1b7172b62af0e6a4e020d | [
"MIT"
] | 1 | 2020-02-16T18:52:31.000Z | 2020-02-16T18:52:31.000Z | cr101.py | quezadaminter/cr101 | 9461852f3146cef467f1b7172b62af0e6a4e020d | [
"MIT"
] | 14 | 2020-01-30T03:48:08.000Z | 2020-02-09T20:07:12.000Z | cr101.py | quezadaminter/CR101 | 9461852f3146cef467f1b7172b62af0e6a4e020d | [
"MIT"
] | null | null | null | #!/bin/python3
import os
import sys
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
import CSS
volumeDialog = None
# if self.eventThread.is_alive():
# self.eventThread.join()
try:
print("CWD: ", os.getcwd())
# Need a better way to inform
# the CR101 code on the path
... | 34.629199 | 101 | 0.666791 | #!/bin/python3
import os
import sys
import soco
from Xlib import X, display
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, GObject, GLib, Gdk
import zonesPage
from zonesPage import ZonesPage, Zones
from MusicPage import MusicPage
from MusicPlayingPage import MusicPlayingPage
from MusicAlbumAr... | 0 | 0 | 0 | 25,146 | 0 | 116 | 0 | 290 | 531 |
c52a7a099a04be64f48b02762c659dd8d384d33b | 997 | py | Python | pyhtmlconv/img.py | aprilahijriyan/pyhtmlconv | 566075f90e7e77f2c874cb4d197ef60bd6e96b32 | [
"MIT"
] | null | null | null | pyhtmlconv/img.py | aprilahijriyan/pyhtmlconv | 566075f90e7e77f2c874cb4d197ef60bd6e96b32 | [
"MIT"
] | null | null | null | pyhtmlconv/img.py | aprilahijriyan/pyhtmlconv | 566075f90e7e77f2c874cb4d197ef60bd6e96b32 | [
"MIT"
] | null | null | null | """
Konversi html ke image (PNG atau JPEG).
"""
from PIL import ImageFile
ImageFile.MAXBLOCK = 2 ** 20
IMAGE_FORMATS = set(
[
"PNG",
"JPEG"
]
)
| 22.155556 | 65 | 0.650953 | """
Konversi html ke image (PNG atau JPEG).
"""
from requests import get as http_get
from io import BytesIO
from imgkit import from_url, from_string
from PIL import Image, ImageFile
from .tools import get_base_url, convert_static_link_to_absolute
ImageFile.MAXBLOCK = 2 ** 20
IMAGE_FORMATS = set(
[
"PNG"... | 0 | 0 | 0 | 0 | 0 | 629 | 0 | 85 | 113 |
834052d3ba2093fdc07bfb4dee4b0e505b008f0b | 2,937 | py | Python | sqlserver_ado/models/query.py | theoriginalgri/django-mssql | 136d69b669c693fc4f999e8f289b0d08d443119f | [
"MIT"
] | null | null | null | sqlserver_ado/models/query.py | theoriginalgri/django-mssql | 136d69b669c693fc4f999e8f289b0d08d443119f | [
"MIT"
] | null | null | null | sqlserver_ado/models/query.py | theoriginalgri/django-mssql | 136d69b669c693fc4f999e8f289b0d08d443119f | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
__all__ = [
'RawStoredProcedureQuery',
'RawStoredProcedureQuerySet',
]
| 34.964286 | 114 | 0.61253 | from __future__ import unicode_literals
from django.db import connections
from django.db.models import sql
from django.db.models.query import RawQuerySet
from sqlserver_ado.dbapi import FetchFailedError
__all__ = [
'RawStoredProcedureQuery',
'RawStoredProcedureQuerySet',
]
class RawStoredProc... | 0 | 1,059 | 0 | 1,528 | 0 | 0 | 0 | 75 | 145 |
3303587c845fc39ecb4d4758a6b509249ba2f19e | 3,871 | py | Python | locations/spiders/boston_market.py | mfjackson/alltheplaces | 37c90b4041c80a574e6e4c2f886883e97df4b636 | [
"MIT"
] | null | null | null | locations/spiders/boston_market.py | mfjackson/alltheplaces | 37c90b4041c80a574e6e4c2f886883e97df4b636 | [
"MIT"
] | null | null | null | locations/spiders/boston_market.py | mfjackson/alltheplaces | 37c90b4041c80a574e6e4c2f886883e97df4b636 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
STATES = [
"AL",
"AK",
"AS",
"AZ",
"AR",
"CA",
"CO",
"CT",
"DE",
"DC",
"FM",
"FL",
"GA",
"GU",
"HI",
"ID",
"IL",
"IN",
"IA",
"KS",
"KY",
"LA",
"ME",
"MH",
"MD",
"MA",
"MI",
"MN",
... | 25.979866 | 88 | 0.483854 | # -*- coding: utf-8 -*-
import scrapy
import json
from locations.items import GeojsonPointItem
STATES = [
"AL",
"AK",
"AS",
"AZ",
"AR",
"CA",
"CO",
"CT",
"DE",
"DC",
"FM",
"FL",
"GA",
"GU",
"HI",
"ID",
"IL",
"IN",
"IA",
"KS",
"KY",
... | 0 | 0 | 0 | 3,147 | 0 | 0 | 0 | 5 | 90 |
8dd2018c7c3f46f6e26e0c8253ea926b13f2a655 | 2,448 | py | Python | src/color.py | wiresnek/Wardle.py | 9167877b295bead2583c63fbb124712dd696ffaf | [
"MIT"
] | 1 | 2022-02-19T03:47:52.000Z | 2022-02-19T03:47:52.000Z | src/color.py | wiresnek/Wardle.py | 9167877b295bead2583c63fbb124712dd696ffaf | [
"MIT"
] | 3 | 2022-03-03T06:23:41.000Z | 2022-03-03T06:32:49.000Z | src/color.py | wiresnek/Wardle.py | 9167877b295bead2583c63fbb124712dd696ffaf | [
"MIT"
] | null | null | null | """
Copyright(c) 2022 SoftFish
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublice... | 41.491525 | 460 | 0.65482 | """
Copyright(c) 2022 SoftFish
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublice... | 0 | 0 | 0 | 0 | 0 | 784 | 0 | 0 | 135 |
e14359484f4ad93f8040cd35d6d364457b2dc582 | 2,263 | py | Python | phototaxis/individual.py | gedeschaines/CS206_2017_Ludobots | cb0c5a830222def0ca6221a9b78113be0da9b2b9 | [
"CC0-1.0"
] | null | null | null | phototaxis/individual.py | gedeschaines/CS206_2017_Ludobots | cb0c5a830222def0ca6221a9b78113be0da9b2b9 | [
"CC0-1.0"
] | null | null | null | phototaxis/individual.py | gedeschaines/CS206_2017_Ludobots | cb0c5a830222def0ca6221a9b78113be0da9b2b9 | [
"CC0-1.0"
] | null | null | null | """ CS206 Spring 2017 ludobots -- Project Phototaxis
https://www.reddit.com/r/ludobots/wiki/pyrosim/phototaxis
"""
| 39.017241 | 103 | 0.588157 | """ CS206 Spring 2017 ludobots -- Project Phototaxis
https://www.reddit.com/r/ludobots/wiki/pyrosim/phototaxis
"""
import pyrosim
import constants as c
from robot import ROBOT
import numpy as np
import random
import math
class INDIVIDUAL:
def __init__(self, id):
self.ID = id
self.genome = ... | 0 | 0 | 0 | 2,007 | 0 | 0 | 0 | -26 | 155 |
91873361f14c6b3ed9d8b47d6bf962d6769aacb0 | 4,886 | py | Python | pytorch/datasets/doors/converter.py | markpp/object_detectors | 8a6cac32ec2d8b578c0d301feceef19390343e85 | [
"MIT"
] | 2 | 2021-03-10T13:13:46.000Z | 2021-03-11T09:03:33.000Z | pytorch/datasets/doors/converter.py | markpp/object_detectors | 8a6cac32ec2d8b578c0d301feceef19390343e85 | [
"MIT"
] | null | null | null | pytorch/datasets/doors/converter.py | markpp/object_detectors | 8a6cac32ec2d8b578c0d301feceef19390343e85 | [
"MIT"
] | null | null | null |
# Make heatmaps using the utility functions from the centernet repo
# Wrapped heatmap function
| 37.29771 | 123 | 0.569177 | import numpy as np
# Make heatmaps using the utility functions from the centernet repo
def draw_msra_gaussian(heatmap, center, sigma=2):
tmp_size = sigma * 6
mu_x = int(center[0] + 0.5)
mu_y = int(center[1] + 0.5)
w, h = heatmap.shape[0], heatmap.shape[1]
ul = [int(mu_x - tmp_size), int(mu_y - tmp_size)]
b... | 0 | 0 | 0 | 0 | 0 | 4,657 | 0 | -3 | 135 |
9bb924d1b0086e653a30c656b4f6cd2ed7d2f351 | 14,247 | py | Python | lib/googlecloudsdk/command_lib/sql/instances.py | bopopescu/Google-Cloud-SDK-1 | c4683bacb2f6192d8a816932e438a0493085469b | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/command_lib/sql/instances.py | bopopescu/Google-Cloud-SDK-1 | c4683bacb2f6192d8a816932e438a0493085469b | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/command_lib/sql/instances.py | bopopescu/Google-Cloud-SDK-1 | c4683bacb2f6192d8a816932e438a0493085469b | [
"Apache-2.0"
] | 1 | 2020-07-24T20:13:29.000Z | 2020-07-24T20:13:29.000Z | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 39.796089 | 80 | 0.685618 | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 0 | 12,359 | 0 | 574 | 0 | 0 | 0 | 182 | 180 |
543b69e8ac5363725d57e7fe203cde05af8a3d27 | 3,370 | py | Python | tasks/UDEMY/100_days/L003/day-3-5.py | AleksNeStu/projects | 1a4c68dfbdcb77228f0f3617e58fd18fcb1f5dbb | [
"Apache-2.0"
] | 2 | 2022-01-19T18:01:35.000Z | 2022-02-06T06:54:38.000Z | tasks/UDEMY/100_days/L003/day-3-5.py | AleksNeStu/projects | 1a4c68dfbdcb77228f0f3617e58fd18fcb1f5dbb | [
"Apache-2.0"
] | null | null | null | tasks/UDEMY/100_days/L003/day-3-5.py | AleksNeStu/projects | 1a4c68dfbdcb77228f0f3617e58fd18fcb1f5dbb | [
"Apache-2.0"
] | null | null | null | # Don't change the code below
print("Welcome to the Love Calculator!")
name1 = input("What is your name? \n")
name2 = input("What is their name? \n")
# Don't change the code above
merged_name = (name1 + name2).upper()
firs_d = sum([merged_name.count(l_f) for l_f in 'TRUE'])
second_d = sum([merged_name.count(l_f) fo... | 23.732394 | 177 | 0.672404 | # 🚨 Don't change the code below 👇
print("Welcome to the Love Calculator!")
name1 = input("What is your name? \n")
name2 = input("What is their name? \n")
# 🚨 Don't change the code above 👆
merged_name = (name1 + name2).upper()
firs_d = sum([merged_name.count(l_f) for l_f in 'TRUE'])
second_d = sum([merged_name.count... | 32 | 0 | 0 | 1,028 | 0 | 0 | 0 | 10 | 90 |
25a0b4e3ccc4984d6f5925b7dc75a0a6107b095d | 906 | py | Python | ndt/bq2ipy.py | m-lab/analysis | cfdcb3475c042f0d2d6fa96ef29c57f8e29c17d9 | [
"Apache-2.0"
] | 4 | 2020-04-11T20:06:59.000Z | 2021-06-30T08:06:31.000Z | ndt/bq2ipy.py | m-lab/analysis | cfdcb3475c042f0d2d6fa96ef29c57f8e29c17d9 | [
"Apache-2.0"
] | 11 | 2019-01-19T02:19:20.000Z | 2021-08-30T22:04:21.000Z | ndt/bq2ipy.py | m-lab/analysis | cfdcb3475c042f0d2d6fa96ef29c57f8e29c17d9 | [
"Apache-2.0"
] | 1 | 2020-06-25T09:48:12.000Z | 2020-06-25T09:48:12.000Z | #!/usr/bin/python
if __name__ == "__main__":
bigquery(None)
| 22.097561 | 85 | 0.628035 | #!/usr/bin/python
import csv
import os
import tempfile
import time
def bigquery(query):
tmpname="/tmp/tmpbq.%s" % time.time()
# load query
l = open("/tmp/log.txt", 'a')
if query is None:
os.system("""echo "count,ips\n80090,34745\n80091,34746" > %s """ % tmpname)
else:
cmd = "bq -q --format=csv query --max_ro... | 0 | 0 | 0 | 0 | 0 | 771 | 0 | -39 | 112 |
20f460b2388e395304d2dd0280712b6a0d23b208 | 3,248 | py | Python | split_folds.py | BrunoKrinski/segtool | cb604b5f38104c43a76450136e37c3d1c4b6d275 | [
"MIT"
] | null | null | null | split_folds.py | BrunoKrinski/segtool | cb604b5f38104c43a76450136e37c3d1c4b6d275 | [
"MIT"
] | null | null | null | split_folds.py | BrunoKrinski/segtool | cb604b5f38104c43a76450136e37c3d1c4b6d275 | [
"MIT"
] | null | null | null | import argparse
import numpy as np
from sklearn.model_selection import KFold
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--dataset', type=str, required='true')
parser.add_argument('--num_folds', type=int, required='true')
args = parser.parse_args()
##########... | 44.493151 | 101 | 0.543719 | import argparse
import numpy as np
from sklearn.model_selection import KFold
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--dataset', type=str, required='true')
parser.add_argument('--num_folds', type=int, required='true')
args = parser.parse_args()
##########... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6c26746f8a7e3df6be49ce73dd3322f08cab0399 | 1,996 | py | Python | talks-articles/machine-learning/toolbox/torch/learning.pytorch.with.examples/01-tensors-warmup-pytorch/warmup-pytorch.py | abhishekkr/tutorials_as_code | f355dc62a5025b710ac6d4a6ac2f9610265fad54 | [
"MIT"
] | 37 | 2015-02-01T23:16:39.000Z | 2021-12-22T16:50:48.000Z | talks-articles/machine-learning/toolbox/torch/learning.pytorch.with.examples/01-tensors-warmup-pytorch/warmup-pytorch.py | abhishekkr/tutorials_as_code | f355dc62a5025b710ac6d4a6ac2f9610265fad54 | [
"MIT"
] | 1 | 2017-03-02T04:55:48.000Z | 2018-01-14T10:51:11.000Z | talks-articles/machine-learning/toolbox/torch/learning.pytorch.with.examples/01-tensors-warmup-pytorch/warmup-pytorch.py | abhishekkr/tutorials_as_code | f355dc62a5025b710ac6d4a6ac2f9610265fad54 | [
"MIT"
] | 15 | 2015-03-02T08:09:01.000Z | 2021-06-10T03:25:41.000Z | # -*- coding: utf-8 -*-
"""
a pytorch tensor is conceptually similar to numpy array
tensor is an n-dimensional array
to run pytorch tensor on GPU, just need to cast it to a new datatype
"""
import torch
dtype = torch.FloatTensor
## for GPU ## dtype = torch.cuda.FloatTensor
## initializing dimensions
BatchSize, In... | 29.352941 | 101 | 0.757014 | # -*- coding: utf-8 -*-
"""
a pytorch tensor is conceptually similar to numpy array
tensor is an n-dimensional array
to run pytorch tensor on GPU, just need to cast it to a new datatype
"""
import torch
dtype = torch.FloatTensor
## for GPU ## dtype = torch.cuda.FloatTensor
## initializing dimensions
BatchSize, In... | 0 | 0 | 0 | 0 | 0 | 699 | 0 | 0 | 69 |
f867d4139fe016e4d7880d3305081bbd03b646bd | 418 | py | Python | Programming basics/Lection 2/Exercises/Chairity Campain.py | antonarnaudov/SoftUniProjects | 01cbdce2b350b57240045d1bc3e21d34f9d0351d | [
"MIT"
] | null | null | null | Programming basics/Lection 2/Exercises/Chairity Campain.py | antonarnaudov/SoftUniProjects | 01cbdce2b350b57240045d1bc3e21d34f9d0351d | [
"MIT"
] | null | null | null | Programming basics/Lection 2/Exercises/Chairity Campain.py | antonarnaudov/SoftUniProjects | 01cbdce2b350b57240045d1bc3e21d34f9d0351d | [
"MIT"
] | null | null | null | daysActive = int(input())
countSweets = int(input())
countCakes = int(input())
countWaffles = int(input())
countPancakes = int(input())
cakePerDay = countCakes * 45
wafflePerDay = countWaffles * 5.80
pancakePerDay = countPancakes * 3.20
sumPerDay = (cakePerDay + wafflePerDay + pancakePerDay) * countSweets
allSum = su... | 26.125 | 69 | 0.736842 | daysActive = int(input())
countSweets = int(input())
countCakes = int(input())
countWaffles = int(input())
countPancakes = int(input())
cakePerDay = countCakes * 45
wafflePerDay = countWaffles * 5.80
pancakePerDay = countPancakes * 3.20
sumPerDay = (cakePerDay + wafflePerDay + pancakePerDay) * countSweets
allSum = su... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
85308175626bd66761ecf1ff3e65436097ef6e32 | 805 | py | Python | ads/exercises/array/buy_sell_stock_once.py | Aminul-Momin/Algorithms_and_Data_Structures | cba73b36b73ad92fb34bc34a0e03503f7a137713 | [
"MIT"
] | null | null | null | ads/exercises/array/buy_sell_stock_once.py | Aminul-Momin/Algorithms_and_Data_Structures | cba73b36b73ad92fb34bc34a0e03503f7a137713 | [
"MIT"
] | null | null | null | ads/exercises/array/buy_sell_stock_once.py | Aminul-Momin/Algorithms_and_Data_Structures | cba73b36b73ad92fb34bc34a0e03503f7a137713 | [
"MIT"
] | null | null | null | """
Write a program that takes an array denoting the daily stock price, and
returns the maximum profit that could be made by buying and then selling one
share of that stock. - [EPI: 5.6].
"""
#==============================================================================
| 30.961538 | 79 | 0.638509 | """
Write a program that takes an array denoting the daily stock price, and
returns the maximum profit that could be made by buying and then selling one
share of that stock. - [EPI: 5.6].
"""
#==============================================================================
def buy_and_sell_stock_once(prices):
min_... | 0 | 0 | 0 | 0 | 0 | 485 | 0 | 0 | 46 |
136cacf00ccb5ee1236add7c74a4f32be760df2e | 8,237 | py | Python | salt/modules/inspectlib/kiwiproc.py | l2ol33rt/salt | ff68bbd9f4bda992a3e039822fb32f141e94347c | [
"Apache-2.0"
] | null | null | null | salt/modules/inspectlib/kiwiproc.py | l2ol33rt/salt | ff68bbd9f4bda992a3e039822fb32f141e94347c | [
"Apache-2.0"
] | null | null | null | salt/modules/inspectlib/kiwiproc.py | l2ol33rt/salt | ff68bbd9f4bda992a3e039822fb32f141e94347c | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright 2016 SUSE 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 agr... | 32.301961 | 119 | 0.560762 | # -*- coding: utf-8 -*-
#
# Copyright 2016 SUSE 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 agr... | 0 | 0 | 0 | 7,222 | 0 | 0 | 0 | 35 | 225 |
28a6ed0907e1a87a1c6d6b25f05eba2ff241f218 | 207 | py | Python | gromozeka/backends/__init__.py | moelius/gromozeka | 6f7f684064ea0414c0bf346e9d3f8804ab4f399b | [
"MIT"
] | 1 | 2020-06-12T17:48:43.000Z | 2020-06-12T17:48:43.000Z | gromozeka/backends/__init__.py | moelius/gromozeka | 6f7f684064ea0414c0bf346e9d3f8804ab4f399b | [
"MIT"
] | 2 | 2018-03-14T16:21:48.000Z | 2018-06-08T14:41:17.000Z | gromozeka/backends/__init__.py | moelius/gromozeka | 6f7f684064ea0414c0bf346e9d3f8804ab4f399b | [
"MIT"
] | null | null | null | from gromozeka.backends.base import BackendAdapter, get_backend_factory
from gromozeka.backends.redis import RedisAioredisAdaptee
__all__ = ['BackendAdapter', 'RedisAioredisAdaptee', 'get_backend_factory']
| 41.4 | 75 | 0.850242 | from gromozeka.backends.base import BackendAdapter, get_backend_factory
from gromozeka.backends.redis import RedisAioredisAdaptee
__all__ = ['BackendAdapter', 'RedisAioredisAdaptee', 'get_backend_factory']
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0caacf3b409f17caf57cfd59378a25ddf87721e3 | 9,384 | py | Python | IIIT_Delhi_assignments/004_Attention_models/Part-1/collab_files/a4_part_1_preprocessing.py | AkankshaShrimal/Deep-Learning-Pytorch-Step-Wise-Learning | 6216027d57fad0aa00c3bc9074d9dab94cf91a39 | [
"MIT"
] | 2 | 2019-02-21T14:38:06.000Z | 2019-07-16T11:50:55.000Z | IIIT_Delhi_assignments/004_Attention_models/Part-1/collab_files/a4_part_1_preprocessing.py | AkankshaShrimal/Deep-Learning-Pytorch-Step-Wise-Learning | 6216027d57fad0aa00c3bc9074d9dab94cf91a39 | [
"MIT"
] | 3 | 2018-12-30T15:49:52.000Z | 2019-01-12T04:34:52.000Z | IIIT_Delhi_assignments/004_Attention_models/Part-1/collab_files/a4_part_1_preprocessing.py | AkankshaShrimal/Deep-Learning-Pytorch-Step-Wise-Learning | 6216027d57fad0aa00c3bc9074d9dab94cf91a39 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""A4_Part_1_Preprocessing.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/112zmgKh5ZpSPwkUI7fki3vp0EcKmPH7h
# Drive
"""
# https://drive.google.com/file/d/19MIw3ZI-Z91NLTDMc8GI4OlIOwN_Vv-t/view?usp=sharing
# gdown https:/... | 30.566775 | 147 | 0.725171 | # -*- coding: utf-8 -*-
"""A4_Part_1_Preprocessing.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/112zmgKh5ZpSPwkUI7fki3vp0EcKmPH7h
# Drive
"""
# https://drive.google.com/file/d/19MIw3ZI-Z91NLTDMc8GI4OlIOwN_Vv-t/view?usp=sharing
# gdown https:/... | 0 | 0 | 0 | 0 | 0 | 1,532 | 0 | 113 | 753 |
1d008ae9e01e8bf677a31566b8515cb5db944e12 | 2,638 | py | Python | src/OTLMOW/OTLModel/Datatypes/KlVerkeersregelaarCoordinatiewijze.py | davidvlaminck/OTLClassPython | 71330afeb37c3ea6d9981f521ff8f4a3f8b946fc | [
"MIT"
] | 2 | 2022-02-01T08:58:11.000Z | 2022-02-08T13:35:17.000Z | src/OTLMOW/OTLModel/Datatypes/KlVerkeersregelaarCoordinatiewijze.py | davidvlaminck/OTLMOW | 71330afeb37c3ea6d9981f521ff8f4a3f8b946fc | [
"MIT"
] | null | null | null | src/OTLMOW/OTLModel/Datatypes/KlVerkeersregelaarCoordinatiewijze.py | davidvlaminck/OTLMOW | 71330afeb37c3ea6d9981f521ff8f4a3f8b946fc | [
"MIT"
] | null | null | null | # coding=utf-8
# Generated with OTLEnumerationCreator. To modify: extend, do not edit
| 67.641026 | 147 | 0.635709 | # coding=utf-8
from OTLMOW.OTLModel.Datatypes.KeuzelijstField import KeuzelijstField
from OTLMOW.OTLModel.Datatypes.KeuzelijstWaarde import KeuzelijstWaarde
# Generated with OTLEnumerationCreator. To modify: extend, do not edit
class KlVerkeersregelaarCoordinatiewijze(KeuzelijstField):
"""Keuzelijst met de voorko... | 0 | 0 | 0 | 2,385 | 0 | 0 | 0 | 98 | 66 |
af3248c24989a42aeda5227175229f13dbdbf814 | 313 | py | Python | management/Hostel/admin.py | imbiswas/student-management-system | 4ef9a4a77848929cdf427bf0cb5f4aa93a9bc518 | [
"MIT"
] | null | null | null | management/Hostel/admin.py | imbiswas/student-management-system | 4ef9a4a77848929cdf427bf0cb5f4aa93a9bc518 | [
"MIT"
] | null | null | null | management/Hostel/admin.py | imbiswas/student-management-system | 4ef9a4a77848929cdf427bf0cb5f4aa93a9bc518 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from django.contrib import admin
# Register your models here.
admin.site.register(Hostel_Details)
admin.site.register(Hostel_Room)
admin.site.register(Hostel_Register)
admin.site.register(Hostel_Allocation)
admin.site.register(Hostel_Visitor)
| 26.083333 | 39 | 0.84345 | from __future__ import unicode_literals
from django.contrib import admin
from Hostel.models import *
# Register your models here.
admin.site.register(Hostel_Details)
admin.site.register(Hostel_Room)
admin.site.register(Hostel_Register)
admin.site.register(Hostel_Allocation)
admin.site.register(Hostel_Visitor)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 22 |
d2e6456cdb3ce5e79aeadfad83c5d4ad438d8c2d | 32 | py | Python | venv/lib/python3.6/token.py | bradjballard/personal_search_engine | 530c5224721a7d700ca0c7c78a513bbc81f05c38 | [
"NCSA"
] | null | null | null | venv/lib/python3.6/token.py | bradjballard/personal_search_engine | 530c5224721a7d700ca0c7c78a513bbc81f05c38 | [
"NCSA"
] | null | null | null | venv/lib/python3.6/token.py | bradjballard/personal_search_engine | 530c5224721a7d700ca0c7c78a513bbc81f05c38 | [
"NCSA"
] | null | null | null | /anaconda/lib/python3.6/token.py | 32 | 32 | 0.8125 | /anaconda/lib/python3.6/token.py | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e9efc8022fe9f6978c86ee7e3b1cf5cf74153a1b | 433 | py | Python | 2-Python-Fundamentals (Jan 2021)/Course-Exercises-and-Exams/01-Basic-Syntax-Conditional-Statements-and-Loops/02_Exercises/07_Maximum-Multiple.py | karolinanikolova/SoftUni-Software-Engineering | 7891924956598b11a1e30e2c220457c85c40f064 | [
"MIT"
] | null | null | null | 2-Python-Fundamentals (Jan 2021)/Course-Exercises-and-Exams/01-Basic-Syntax-Conditional-Statements-and-Loops/02_Exercises/07_Maximum-Multiple.py | karolinanikolova/SoftUni-Software-Engineering | 7891924956598b11a1e30e2c220457c85c40f064 | [
"MIT"
] | null | null | null | 2-Python-Fundamentals (Jan 2021)/Course-Exercises-and-Exams/01-Basic-Syntax-Conditional-Statements-and-Loops/02_Exercises/07_Maximum-Multiple.py | karolinanikolova/SoftUni-Software-Engineering | 7891924956598b11a1e30e2c220457c85c40f064 | [
"MIT"
] | null | null | null | # 7. Maximum Multiple
# Given a Divisor and a Bound, find the largest integer N, such that:
# N is divisible by divisor
# N is less than or equal to bound
# N is greater than 0.
# Notes: The divisor and bound are only positive values. It's guaranteed that a divisor is found
divisor = int(input())
bound = int(input())
... | 20.619048 | 96 | 0.669746 | # 7. Maximum Multiple
# Given a Divisor and a Bound, find the largest integer N, such that:
# N is divisible by divisor
# N is less than or equal to bound
# N is greater than 0.
# Notes: The divisor and bound are only positive values. It's guaranteed that a divisor is found
divisor = int(input())
bound = int(input())
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0a63d6efc847313d0eceffd4812cb122453e50bd | 2,433 | py | Python | benchmarks/01-LE10-Thick-Plate/python_postprocessing/calculix_automate.py | dantelimac/CoFEA | b5520c66fa5f62d0ceadffd7cef6cae463ea5084 | [
"BSD-4-Clause"
] | null | null | null | benchmarks/01-LE10-Thick-Plate/python_postprocessing/calculix_automate.py | dantelimac/CoFEA | b5520c66fa5f62d0ceadffd7cef6cae463ea5084 | [
"BSD-4-Clause"
] | null | null | null | benchmarks/01-LE10-Thick-Plate/python_postprocessing/calculix_automate.py | dantelimac/CoFEA | b5520c66fa5f62d0ceadffd7cef6cae463ea5084 | [
"BSD-4-Clause"
] | null | null | null | import glob as gb
import os
# Function changing input mesh inside the model.inp file
# Function which starts ccx solver and copy results
os.mkdir("Results")
# Check the meshes in Mesh folder
mesh_file_mames = gb.glob("Mesh/*.inp")
# Name of the input inp file for CalculiX
ccx_input_file = ("model")
for mesh_fi... | 30.037037 | 80 | 0.700781 | import numpy as np
import subprocess
import glob as gb
import shutil
import time
import os
import logging
import ccx2paraview
# Function changing input mesh inside the model.inp file
def change_model_inp (input_file, change_mesh):
# Input mesh path
mesh_path = "*INCLUDE, INPUT="+ change_mesh + "\n"
#... | 0 | 0 | 0 | 0 | 0 | 1,802 | 0 | -34 | 176 |
7deb29f0a91e093a50071f5b96fe1e74e6608507 | 557 | py | Python | stocktalk/listen.py | sugengsuprayogi/Stocktalk | 3c9cf8edef7a693c9dfee22af03a70fd26ce155e | [
"MIT"
] | 530 | 2016-10-19T14:08:19.000Z | 2020-08-01T00:39:59.000Z | stocktalk/listen.py | tungvuthanh/Stocktalk | b726f345ca6f0bfda2c7ef6b8a4a68e9561ea0db | [
"MIT"
] | 7 | 2016-11-04T03:43:00.000Z | 2018-10-28T23:00:01.000Z | stocktalk/listen.py | tungvuthanh/Stocktalk | b726f345ca6f0bfda2c7ef6b8a4a68e9561ea0db | [
"MIT"
] | 147 | 2016-10-29T20:48:44.000Z | 2020-07-18T13:35:48.000Z | from scripts import settings, streaming
# Query keys categorize tweets
# Each key or category corresponds to an array of keywords
queries = {'ETH': ['ETH', 'Ethereum'],
'LTC': ['LTC', 'Litecoin'],
'BTC': ['BTC', 'Bitcoin'],
'XRP': ['XRP', 'Ripple'],
'XLM': ['XLM', 'Stellar']... | 29.315789 | 58 | 0.543986 | from scripts import settings, streaming
# Query keys categorize tweets
# Each key or category corresponds to an array of keywords
queries = {'ETH': ['ETH', 'Ethereum'],
'LTC': ['LTC', 'Litecoin'],
'BTC': ['BTC', 'Bitcoin'],
'XRP': ['XRP', 'Ripple'],
'XLM': ['XLM', 'Stellar']... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d9bc8bb2dc5780be0529b00a064aee840bff34e6 | 2,507 | py | Python | pytype/module_utils_test.py | kianmeng/pytype | b64248d6f8d9553da5b2f258fd6ad31d18b001d4 | [
"Apache-2.0"
] | 1 | 2021-12-31T08:46:43.000Z | 2021-12-31T08:46:43.000Z | pytype/module_utils_test.py | kianmeng/pytype | b64248d6f8d9553da5b2f258fd6ad31d18b001d4 | [
"Apache-2.0"
] | null | null | null | pytype/module_utils_test.py | kianmeng/pytype | b64248d6f8d9553da5b2f258fd6ad31d18b001d4 | [
"Apache-2.0"
] | null | null | null | """Tests for module_utils.py."""
from pytype import file_utils
import unittest
# Because TestInferModule expands a lot of paths:
expand = file_utils.expand_path
if __name__ == "__main__":
unittest.main()
| 35.309859 | 78 | 0.678101 | """Tests for module_utils.py."""
import os
from pytype import file_utils
from pytype import module_utils
import unittest
class ModuleUtilsTest(unittest.TestCase):
"""Test module utilities."""
def test_get_absolute_name(self):
test_cases = [
("x.y", "a.b", "x.y.a.b"),
("", "a.b", "a.b"),
... | 0 | 0 | 0 | 2,204 | 0 | 0 | 0 | -2 | 91 |
b6dc396a941fcb9e433534fbd1e0c2e568e71f9a | 302 | py | Python | forge/lib/logs.py | Pandinosaurus/3d-forge | d631e14a9351911c3e5612c73c1608d97ed547d2 | [
"BSD-3-Clause"
] | 31 | 2015-07-13T15:36:50.000Z | 2022-02-07T21:37:51.000Z | forge/lib/logs.py | Pandinosaurus/3d-forge | d631e14a9351911c3e5612c73c1608d97ed547d2 | [
"BSD-3-Clause"
] | 109 | 2015-04-24T10:03:24.000Z | 2019-04-12T13:34:01.000Z | forge/lib/logs.py | Pandinosaurus/3d-forge | d631e14a9351911c3e5612c73c1608d97ed547d2 | [
"BSD-3-Clause"
] | 16 | 2015-10-03T06:03:22.000Z | 2022-03-31T08:24:37.000Z | # -*- coding: utf-8 -*-
import logging
| 23.230769 | 59 | 0.675497 | # -*- coding: utf-8 -*-
import logging
import logging.config
def getLogger(config, name, suffix=''):
logFile = config.get('Logging', 'logfile')
logging.config.fileConfig('logging.cfg', defaults=dict(
logfile=logFile % dict(timestamp=suffix)
))
return logging.getLogger(name)
| 0 | 0 | 0 | 0 | 0 | 216 | 0 | 0 | 45 |
b9069c63d8d391406c42c11771cd424aa3138c80 | 2,252 | py | Python | Scripts/parser.py | JDowns412/IPv6-Tracer | 2f6c4466e44ae6126bae538466686be54107dddd | [
"MIT"
] | 3 | 2021-05-29T20:24:50.000Z | 2021-05-29T20:28:44.000Z | Scripts/parser.py | JDowns412/IPv6-Tracer | 2f6c4466e44ae6126bae538466686be54107dddd | [
"MIT"
] | null | null | null | Scripts/parser.py | JDowns412/IPv6-Tracer | 2f6c4466e44ae6126bae538466686be54107dddd | [
"MIT"
] | 6 | 2017-09-27T16:16:03.000Z | 2022-02-15T23:26:17.000Z |
if __name__ == "__main__":
goalLength = 5
parse(goalLength) | 35.1875 | 81 | 0.580817 | import os, json, math, pprint
def parse(length):
# change to the directory where the Alexa lists are
os.chdir("../Data")
files = []
data = {}
domains = set()
results = {"sites" : []}
for file in os.listdir():
if (file.split(".")[-1] == "py" or file.split(".")[-1] == "json"):
... | 0 | 0 | 0 | 0 | 0 | 2,130 | 0 | 8 | 45 |
f0178890c16b6ce3702a7c1ddd24c47dddb5b3d0 | 10,107 | py | Python | src/opensignals/data/provider.py | cshanes/opensignals | 874781015fed75f91597ede0948a1abfdb7d2b19 | [
"Apache-2.0"
] | null | null | null | src/opensignals/data/provider.py | cshanes/opensignals | 874781015fed75f91597ede0948a1abfdb7d2b19 | [
"Apache-2.0"
] | null | null | null | src/opensignals/data/provider.py | cshanes/opensignals | 874781015fed75f91597ede0948a1abfdb7d2b19 | [
"Apache-2.0"
] | null | null | null | import logging
logger = logging.getLogger(__name__)
AWS_BASE_URL = 'https://numerai-signals-public-data.s3-us-west-2.amazonaws.com'
SIGNALS_UNIVERSE = f'{AWS_BASE_URL}/latest_universe.csv'
SIGNALS_TICKER_MAP = f'{AWS_BASE_URL}/signals_ticker_map_w_bbg.csv'
SIGNALS_TARGETS = f'{AWS_BASE_URL}/signals_train_val_bbg.csv... | 38.724138 | 117 | 0.63174 | from abc import ABC, abstractmethod
from concurrent import futures
import datetime as dt
import logging
import pathlib
import shutil
from typing import Optional, List, Tuple
from dateutil.relativedelta import relativedelta, FR
import pandas as pd
from tqdm import tqdm
from opensignals import features
logger = loggi... | 0 | 4,792 | 0 | 4,680 | 0 | 0 | 0 | 67 | 245 |
7650cad4a9dd2eb9d21075208688373aa70ce06e | 306 | py | Python | Easy/0566 Reshape the Matrix.py | raj713335/LeetCode | e60e145d90f45d37e148e8307a3d97f5f0741de0 | [
"Apache-2.0"
] | null | null | null | Easy/0566 Reshape the Matrix.py | raj713335/LeetCode | e60e145d90f45d37e148e8307a3d97f5f0741de0 | [
"Apache-2.0"
] | null | null | null | Easy/0566 Reshape the Matrix.py | raj713335/LeetCode | e60e145d90f45d37e148e8307a3d97f5f0741de0 | [
"Apache-2.0"
] | null | null | null | # https://leetcode.com/problems/reshape-the-matrix/
| 20.4 | 85 | 0.539216 | # https://leetcode.com/problems/reshape-the-matrix/
import numpy as np
class Solution:
def matrixReshape(self, mat: List[List[int]], r: int, c: int) -> List[List[int]]:
try:
return np.reshape(mat, (r,c)).tolist()
except:
return mat
| 0 | 0 | 0 | 192 | 0 | 0 | 0 | -3 | 46 |
70d2ffcaa021ada70ddaffd537d358e2cce305c3 | 2,590 | py | Python | Model/testBPspeed.py | Lauffenburger-Lab/Artificial-Signaling-Network | 707e79c7e2ad341d68a719443b9e17fe9e7bb7c1 | [
"MIT"
] | 4 | 2021-11-12T17:35:05.000Z | 2022-03-16T19:12:00.000Z | Model/testBPspeed.py | Lauffenburger-Lab/Artificial-Signaling-Network | 707e79c7e2ad341d68a719443b9e17fe9e7bb7c1 | [
"MIT"
] | null | null | null | Model/testBPspeed.py | Lauffenburger-Lab/Artificial-Signaling-Network | 707e79c7e2ad341d68a719443b9e17fe9e7bb7c1 | [
"MIT"
] | 1 | 2021-11-17T14:53:41.000Z | 2021-11-17T14:53:41.000Z | import torch
import bionetwork
import numpy
import time
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression
networkSize = numpy.array([1000, 3000, 5000, 7000, 9000, 11000, 13000, 15000, 17000, 19000])
batchsize = 3
repeats = 5
parameters = bionetwork.trainingParameters(iterations=150, c... | 30.116279 | 95 | 0.699614 | import torch
import bionetwork
import numpy
import time
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression
def makeNetwork(curSize):
interactionsPerNode = 10
sparsity = interactionsPerNode/curSize
networkList, nodeNames = bionetwork.getRandomNet(curSize, sparsity)
MOA = n... | 0 | 0 | 0 | 0 | 0 | 310 | 0 | 0 | 23 |
332f0889cac1df0e0df03efa5d55406a0a47b7b8 | 15 | py | Python | 04-The-Matrix/02-Implement-Our-Own-Matrix/playLA/_globals.py | hcc817/Mtianyan-Play-with-Linear-Algebra | 80e95a13cee0c4a8251adb84ff21956e7553638c | [
"Apache-2.0"
] | 1 | 2021-03-18T23:05:59.000Z | 2021-03-18T23:05:59.000Z | playLA/_global.py | limh909/LinerAlgebra | 9b23c319287694e7a2861b5db12ce1eedc1e338f | [
"MIT"
] | null | null | null | playLA/_global.py | limh909/LinerAlgebra | 9b23c319287694e7a2861b5db12ce1eedc1e338f | [
"MIT"
] | 1 | 2021-03-18T23:06:09.000Z | 2021-03-18T23:06:09.000Z | EPSILON = 1e-8
| 7.5 | 14 | 0.666667 | EPSILON = 1e-8
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9e4d58eb86e8d1bd034953438f71d6af88bceb96 | 44 | py | Python | src/amuse/community/mmc/__init__.py | sibonyves/amuse | 5557bf88d14df1aa02133a199b6d60c0c57dcab7 | [
"Apache-2.0"
] | null | null | null | src/amuse/community/mmc/__init__.py | sibonyves/amuse | 5557bf88d14df1aa02133a199b6d60c0c57dcab7 | [
"Apache-2.0"
] | 12 | 2021-11-15T09:13:03.000Z | 2022-02-02T14:53:04.000Z | src/amuse/community/mmc/__init__.py | sibonyves/amuse | 5557bf88d14df1aa02133a199b6d60c0c57dcab7 | [
"Apache-2.0"
] | null | null | null | # generated file
| 14.666667 | 26 | 0.795455 | # generated file
from .interface import Mmc
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | 22 |
0a89d33b19f15e53e187affddc80791a2c2f143b | 5,117 | py | Python | src/attrbox/attrdict.py | metaist/attrbox | 68c595f58e641f6e8ab1d5eb0bd163819823dd25 | [
"MIT"
] | null | null | null | src/attrbox/attrdict.py | metaist/attrbox | 68c595f58e641f6e8ab1d5eb0bd163819823dd25 | [
"MIT"
] | null | null | null | src/attrbox/attrdict.py | metaist/attrbox | 68c595f58e641f6e8ab1d5eb0bd163819823dd25 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
"""Attribute-based dictionary."""
# native
from typing import Any, Dict, Type
ADict = Dict[Any, Any]
"""`Dict` with `Any` key and `Any` value."""
def dict_merge(dest: ADict, *sources: ADict, default: Type[ADict] = dict) -> ADict:
"""Recursively merge dictionaries into the f... | 25.713568 | 83 | 0.469807 | #!/usr/bin/env python
# coding: utf-8
"""Attribute-based dictionary."""
# native
from typing import Any, Dict, Type
ADict = Dict[Any, Any]
"""`Dict` with `Any` key and `Any` value."""
def dict_merge(dest: ADict, *sources: ADict, default: Type[ADict] = dict) -> ADict:
"""Recursively merge dictionaries into the f... | 0 | 0 | 0 | 2,492 | 0 | 0 | 0 | 0 | 23 |
e3fe038b8da3bb50a27dee5152fa03c2978c0bf6 | 12,460 | py | Python | PyZ3950/c2query.py | danizen/PyZ3950 | 6d44a4ab85c8bda3a7542c2c9efdfad46c830219 | [
"MIT"
] | 2 | 2020-10-07T23:51:48.000Z | 2021-11-30T10:59:43.000Z | PyZ3950/c2query.py | heaphey/PyZ3950 | 399b7874c95276e8f6095f7480b488f98a21379a | [
"MIT"
] | null | null | null | PyZ3950/c2query.py | heaphey/PyZ3950 | 399b7874c95276e8f6095f7480b488f98a21379a | [
"MIT"
] | 2 | 2021-11-04T15:32:17.000Z | 2022-01-24T11:06:24.000Z | #!/usr/local/bin/python2.3
# We need "\"\"" to be one token
from PyZ3950.CQLUtils import ZCQLConfig
zconfig = ZCQLConfig()
"""
http://cheshire.berkeley.edu/cheshire2.html#zfind
top ::= query ['resultsetid' name]
query ::= query boolean clause | clause
clause ::= '(' query ')'
| attri... | 31.15 | 135 | 0.398555 | #!/usr/local/bin/python2.3
from io import StringIO
from PyZ3950 import z3950, oids
# We need "\"\"" to be one token
from PyZ3950.CQLParser import CQLshlex
from PyZ3950.CQLUtils import ZCQLConfig
from PyZ3950.zdefs import make_attr
zconfig = ZCQLConfig()
"""
http://cheshire.berkeley.edu/cheshire2.html#zfind
top ... | 0 | 0 | 0 | 8,450 | 0 | 320 | 0 | 43 | 135 |
384a3eaed8eee9fb82703b0ca9675bf087bbd48c | 4,308 | py | Python | Session09_AWSSagemakerAndLargeScaleModelTraining/CIFAR100Classifier.py | garima-mahato/TSAI_EMLO1.0 | f1478572a20988296831e70d6cf1dac9b36e7573 | [
"Apache-2.0"
] | null | null | null | Session09_AWSSagemakerAndLargeScaleModelTraining/CIFAR100Classifier.py | garima-mahato/TSAI_EMLO1.0 | f1478572a20988296831e70d6cf1dac9b36e7573 | [
"Apache-2.0"
] | null | null | null | Session09_AWSSagemakerAndLargeScaleModelTraining/CIFAR100Classifier.py | garima-mahato/TSAI_EMLO1.0 | f1478572a20988296831e70d6cf1dac9b36e7573 | [
"Apache-2.0"
] | null | null | null | import torch.nn as nn
| 39.522936 | 248 | 0.620241 | import os
import math
import random
import numpy
import torch
import torch.nn as nn
from torch.nn import functional as F
from torch.utils.data import DataLoader
from torch.utils.data.sampler import SubsetRandomSampler
from torchvision import transforms as T, datasets, models
import pytorch_lightning as pl
def accurac... | 0 | 0 | 0 | 3,828 | 0 | 122 | 0 | 65 | 267 |
a308ff26bc65d92cf13f333b6ecaf580dea83e4b | 860 | py | Python | Untitled-1.py | hawk-unity/systempc | f4ef976cebd623efe4023bd2e0f2a542524f8cf4 | [
"Apache-2.0"
] | null | null | null | Untitled-1.py | hawk-unity/systempc | f4ef976cebd623efe4023bd2e0f2a542524f8cf4 | [
"Apache-2.0"
] | null | null | null | Untitled-1.py | hawk-unity/systempc | f4ef976cebd623efe4023bd2e0f2a542524f8cf4 | [
"Apache-2.0"
] | null | null | null | import platform
first=" Sistem :" ,platform.system()
second="sim :", platform.node()
three="letim Sistemi :", platform.platform()
four="lemci :" ,platform.processor()
five="Bit :" ,platform.machine()
six="Genel :" ,platform.uname()
print("""
- WarriorTurks Python3 rnekleri -
1 - Sistem
2-... | 24.571429 | 90 | 0.563953 | import platform
first=" Sistem :" ,platform.system()
second="İsim :", platform.node()
three="İşletim Sistemi :", platform.platform()
four="İşlemci :" ,platform.processor()
five="Bit :" ,platform.machine()
six="Genel :" ,platform.uname()
print("""
- WarriorTurks Python3 Örnekleri -
1 - Sistem... | 54 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d5b3f268b10714ca8964110284761384716d6d95 | 759 | py | Python | test/test_day_06.py | eduellery/aoc-2015 | 378a213e21c5b52658c1cec961f7bd80a86ef090 | [
"MIT"
] | 1 | 2022-02-15T08:54:51.000Z | 2022-02-15T08:54:51.000Z | test/test_day_06.py | eduellery/aoc-2015 | 378a213e21c5b52658c1cec961f7bd80a86ef090 | [
"MIT"
] | null | null | null | test/test_day_06.py | eduellery/aoc-2015 | 378a213e21c5b52658c1cec961f7bd80a86ef090 | [
"MIT"
] | null | null | null | from aoc.day_06 import Day06
from resources import read_as_string_list
aoc_input = Day06(read_as_string_list('test/day06.in'))
| 25.3 | 117 | 0.714097 | from typing import List
import pytest
from aoc.day_06 import Day06
from resources import read_as_string_list
aoc_input = Day06(read_as_string_list('test/day06.in'))
def test_solve_1_examples():
test: List[str] = ['turn on 0,0 through 999,999', 'toggle 0,0 through 999,0', 'turn off 499,499 through 500,500']
... | 0 | 234 | 0 | 0 | 0 | 261 | 0 | -6 | 137 |
63a5d6a21c88b692edc6575ba6bd2ff5a82a0bd0 | 11,774 | py | Python | main.py | yell/kf2-hardcore-endless | fda814796588a551d9a020ae02ac0292a4b14efd | [
"MIT"
] | 3 | 2021-12-29T07:45:46.000Z | 2022-01-11T10:16:42.000Z | main.py | monsta-hd/kf2-hardcore-endless | fda814796588a551d9a020ae02ac0292a4b14efd | [
"MIT"
] | null | null | null | main.py | monsta-hd/kf2-hardcore-endless | fda814796588a551d9a020ae02ac0292a4b14efd | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import os.path
import yaml
Z = KF2_ZED
KF2 = KF2_EndlessUtility
def make_line_const_interp((x0, y0), (x1, y1)):
"""Same as `make_line_interp`, but extrapolated constantly beyond [x0; x1]."""
m = min(x0, x1)
M = max(x0, x1)
return f
... | 34.83432 | 107 | 0.596908 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import os.path
import yaml
class KF2_ZED(object):
# small zeds
Clot = 'Clot_Alpha'
Rioter = 'Clot_AlphaKing'
AlphaClot = 'Clot_Alpha_Versus'
Cyst = 'Clot_Cyst'
Slasher = 'Clot_Slasher'
AlphaSlasher = 'Clot_Slasher_Versus'
C... | 0 | 2,687 | 0 | 7,116 | 0 | 869 | 0 | 0 | 141 |
919598c2947e11732a6418a91eb458068904f419 | 20,794 | py | Python | theano/tensor/tests/test_elemwise.py | josharian/Theano | 724a25692090fee26eebf72f5d046ca8662089c1 | [
"BSD-3-Clause"
] | 1 | 2016-05-07T14:52:38.000Z | 2016-05-07T14:52:38.000Z | theano/tensor/tests/test_elemwise.py | josharian/Theano | 724a25692090fee26eebf72f5d046ca8662089c1 | [
"BSD-3-Clause"
] | null | null | null | theano/tensor/tests/test_elemwise.py | josharian/Theano | 724a25692090fee26eebf72f5d046ca8662089c1 | [
"BSD-3-Clause"
] | null | null | null | import unittest
if __name__ == '__main__':
#unittest.main()
suite = unittest.TestSuite([test_Prod('test_mul_without_zeros_zeros')])
#suite.addTest(test_Prod('test_verify_grad_with_zeros'))
#suite.addTest(test_Prod('test_prod_without_zeros'))
#suite.addTest(test_Prod('test_other_grad_tests'))
... | 40.933071 | 117 | 0.502789 | import cPickle, time, unittest
from numpy.testing import dec
from theano.gof import Variable, Op
from theano import gof
from theano.scalar import *
from theano import tensor
from theano.compile.mode import get_default_mode
from theano.tensor.elemwise import *
from theano.tests import unittest_tools
def Env(i, o):... | 0 | 1,524 | 0 | 18,456 | 0 | 28 | 0 | 108 | 318 |
bb2af03eacc3773d43d791115ed002d43106d06b | 2,051 | py | Python | quarantine/model/qlocation.py | kwoolter/Quarantine | 7b824a3d6eebbded611c48e44dcb3c2e4007033e | [
"BSD-2-Clause"
] | null | null | null | quarantine/model/qlocation.py | kwoolter/Quarantine | 7b824a3d6eebbded611c48e44dcb3c2e4007033e | [
"BSD-2-Clause"
] | null | null | null | quarantine/model/qlocation.py | kwoolter/Quarantine | 7b824a3d6eebbded611c48e44dcb3c2e4007033e | [
"BSD-2-Clause"
] | null | null | null |
if __name__ == "__main__":
QLocationFactory.load("locations.csv")
names = QLocationFactory.get_available_objects()
for name in names:
r = QLocationFactory.get_object_by_name(name)
print(r) | 28.09589 | 62 | 0.63725 | import pandas as pd
import logging
from pathlib import Path
class QLocation():
def __init__(self, name:str):
self.name = name
self.properties = {}
self.linked_locations = {}
def add_properties(self, new_properties: dict):
self.properties.update(new_properties)
def add_link... | 0 | 739 | 0 | 986 | 0 | 0 | 0 | -6 | 112 |
9dfb3cc31dff4eac63eccdca1fb049f5033d1548 | 239 | py | Python | tests/context.py | tmarlok88/wedding-rsvp | ce754fccfcf33e9b89c641d22c13b1b4adc2f9d5 | [
"Beerware"
] | 1 | 2021-04-16T09:02:45.000Z | 2021-04-16T09:02:45.000Z | tests/context.py | tmarlok88/wedding-rsvp | ce754fccfcf33e9b89c641d22c13b1b4adc2f9d5 | [
"Beerware"
] | null | null | null | tests/context.py | tmarlok88/wedding-rsvp | ce754fccfcf33e9b89c641d22c13b1b4adc2f9d5 | [
"Beerware"
] | null | null | null | import os
import sys
from unittest import mock
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
with mock.patch.dict(os.environ, {"AWS_REGION": "us-west-1", "DYNAMO_TABLE": "fake-table"}):
| 29.875 | 92 | 0.711297 | import os
import sys
from unittest import mock
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
with mock.patch.dict(os.environ, {"AWS_REGION": "us-west-1", "DYNAMO_TABLE": "fake-table"}):
import app
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | -11 | 26 |
81426d65f067abb633c879827acfff78f63536d0 | 1,430 | py | Python | homeassistant/components/recorder/purge.py | petewill/home-assistant | 5859dba4344f05fb8774aa1207e47ac28f627a67 | [
"Apache-2.0"
] | 3 | 2019-10-15T16:55:31.000Z | 2020-02-18T21:10:31.000Z | homeassistant/components/recorder/purge.py | petewill/home-assistant | 5859dba4344f05fb8774aa1207e47ac28f627a67 | [
"Apache-2.0"
] | 39 | 2016-12-16T12:40:34.000Z | 2017-02-13T17:53:42.000Z | homeassistant/components/recorder/purge.py | petewill/home-assistant | 5859dba4344f05fb8774aa1207e47ac28f627a67 | [
"Apache-2.0"
] | 4 | 2019-10-15T21:03:53.000Z | 2020-05-27T19:53:20.000Z | """Purge old data helper."""
from datetime import timedelta
import logging
import homeassistant.util.dt as dt_util
from .util import session_scope
_LOGGER = logging.getLogger(__name__)
def purge_old_data(instance, purge_days, repack):
"""Purge events and states older than purge_days ago."""
from .models im... | 33.255814 | 70 | 0.646154 | """Purge old data helper."""
from datetime import timedelta
import logging
import homeassistant.util.dt as dt_util
from .util import session_scope
_LOGGER = logging.getLogger(__name__)
def purge_old_data(instance, purge_days, repack):
"""Purge events and states older than purge_days ago."""
from .models im... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
dcb9ba61c2d27e4ab5016a99e2350a41072131be | 4,037 | py | Python | scripts/metaworld_obs_mwe.py | mtcrawshaw/meta-world | b511885af4405715c7b35f8295cef88021a926be | [
"MIT"
] | 4 | 2021-09-21T07:24:26.000Z | 2022-03-25T00:28:33.000Z | scripts/metaworld_obs_mwe.py | mtcrawshaw/meta | b511885af4405715c7b35f8295cef88021a926be | [
"MIT"
] | null | null | null | scripts/metaworld_obs_mwe.py | mtcrawshaw/meta | b511885af4405715c7b35f8295cef88021a926be | [
"MIT"
] | null | null | null | import random
import numpy as np
import metaworld
SEED = 1
EPISODE_LEN = 200
NUM_EPISODES = 10
DECIMAL_PRECISION = 3
# Set random seed.
random.seed(SEED)
np.random.seed(SEED)
# Create kwargs list for ML45_train and ML_45 test.
kwargs_list = []
benchmark = metaworld.ML45()
kwargs_list.append(
{
"en... | 30.583333 | 88 | 0.668566 | import random
import pickle
import numpy as np
import metaworld
from metaworld import Task
SEED = 1
EPISODE_LEN = 200
NUM_EPISODES = 10
DECIMAL_PRECISION = 3
def get_goal(obs):
return list(obs[36:39])
def get_hand_pos(obs):
return list(obs[:3])
def get_obj_pos(obs):
return list(obs[3:17])
def che... | 0 | 0 | 0 | 0 | 0 | 1,693 | 0 | -3 | 136 |
8b55b569cb789e680bcd418330663ae846960302 | 2,583 | py | Python | dp/b.py | nishio/atcoder | 8db36537b5d8580745d5f98312162506ad7d7ab4 | [
"MIT"
] | 1 | 2021-03-09T04:28:13.000Z | 2021-03-09T04:28:13.000Z | dp/b.py | nishio/atcoder | 8db36537b5d8580745d5f98312162506ad7d7ab4 | [
"MIT"
] | null | null | null | dp/b.py | nishio/atcoder | 8db36537b5d8580745d5f98312162506ad7d7ab4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**6)
input = sys.stdin.buffer.readline
INF = 10 ** 9 + 1 # sys.maxsize # float("inf")
def _test():
"""
>>> solve(5, 3, [10, 30, 40, 50, 20])
30
>>> solve(3, 1, [10, 20, 10])
20
>>> solve(2, 100, [10, 10])
0
>>> solve(10, ... | 22.657895 | 74 | 0.52923 | #!/usr/bin/env python3
from collections import defaultdict
from heapq import heappush, heappop
import sys
sys.setrecursionlimit(10**6)
input = sys.stdin.buffer.readline
INF = 10 ** 9 + 1 # sys.maxsize # float("inf")
def debug(*x):
print(*x)
def solve1(N, K, heights):
heights += [INF] * K
costs = [INF... | 0 | 0 | 0 | 0 | 0 | 954 | 0 | 34 | 213 |
fbdd17ea7e5676ca7ae581b195d93aff9ccc212d | 8,936 | py | Python | modeltranslation_rosetta/forms.py | Apkawa/django-modeltranslation-rosetta | 568354ceee201f891e1f9f6d1f5987dbdfa8f84a | [
"MIT"
] | null | null | null | modeltranslation_rosetta/forms.py | Apkawa/django-modeltranslation-rosetta | 568354ceee201f891e1f9f6d1f5987dbdfa8f84a | [
"MIT"
] | 14 | 2020-01-06T16:18:37.000Z | 2022-01-20T19:40:56.000Z | modeltranslation_rosetta/forms.py | Apkawa/django-modeltranslation-rosetta | 568354ceee201f891e1f9f6d1f5987dbdfa8f84a | [
"MIT"
] | null | null | null | # coding: utf-8
from __future__ import unicode_literals
| 38.025532 | 137 | 0.573187 | # coding: utf-8
from __future__ import unicode_literals
from itertools import chain
from django import forms
from django.forms.formsets import TOTAL_FORM_COUNT
from django.forms.models import fields_for_model
from django.utils.translation import ungettext
from modeltranslation_rosetta.settings import DEFAULT_FROM_LA... | 0 | 0 | 0 | 8,321 | 0 | 0 | 0 | 262 | 293 |
4a3c2750c6220f49d356e9afaa41cd27df21e30f | 2,404 | py | Python | siwa/library/token/token.py | loopwerk/siwa-python | 3850b5a90e525a37745f1e01edc6fcc6be4e0927 | [
"MIT"
] | 2 | 2021-10-11T19:48:51.000Z | 2022-01-13T23:20:02.000Z | siwa/library/token/token.py | loopwerk/siwa-python | 3850b5a90e525a37745f1e01edc6fcc6be4e0927 | [
"MIT"
] | 3 | 2021-09-17T14:54:36.000Z | 2022-03-28T21:17:28.000Z | siwa/library/token/token.py | loopwerk/siwa-python | 3850b5a90e525a37745f1e01edc6fcc6be4e0927 | [
"MIT"
] | 1 | 2021-09-17T14:58:06.000Z | 2021-09-17T14:58:06.000Z | """
Signin With Apple
Token Module
author: hugh@blinkybeach.com
"""
from typing import TypeVar
T = TypeVar('T', bound='IdentityToken')
| 26.417582 | 74 | 0.604409 | """
Signin With Apple
Token Module
author: hugh@blinkybeach.com
"""
import jwt
from jwt.exceptions import PyJWTError
from typing import TypeVar, Type, Any, Dict, Union, Optional
from siwa.library.data import Data
import json
from siwa.library.key_cache import KeyCache
from siwa.library.token.header import Header
from s... | 0 | 687 | 0 | 1,291 | 0 | 0 | 0 | 112 | 177 |
101e6b9d549d9687d348800ce0d02812243754e2 | 3,989 | py | Python | pysteps/tests/test_utils_transformation.py | leabeusch/pysteps | 5f162d4b1155e4cfd894c9635eed3f0e823adedd | [
"BSD-3-Clause"
] | 285 | 2018-07-11T10:42:43.000Z | 2022-03-23T13:44:54.000Z | pysteps/tests/test_utils_transformation.py | leabeusch/pysteps | 5f162d4b1155e4cfd894c9635eed3f0e823adedd | [
"BSD-3-Clause"
] | 246 | 2018-07-16T06:17:12.000Z | 2022-03-22T15:45:08.000Z | pysteps/tests/test_utils_transformation.py | leabeusch/pysteps | 5f162d4b1155e4cfd894c9635eed3f0e823adedd | [
"BSD-3-Clause"
] | 97 | 2018-07-12T12:05:45.000Z | 2022-03-31T14:56:31.000Z | # -*- coding: utf-8 -*-
import numpy as np
# boxcox_transform
test_data = [
(
np.array([1]),
{
"accutime": 5,
"transform": None,
"unit": "mm/h",
"threshold": 0,
"zerovalue": 0,
},
None,
None,
None,
... | 20.884817 | 88 | 0.462271 | # -*- coding: utf-8 -*-
import numpy as np
import pytest
from numpy.testing import assert_array_almost_equal
from pysteps.utils import transformation
# boxcox_transform
test_data = [
(
np.array([1]),
{
"accutime": 5,
"transform": None,
"unit": "mm/h",
... | 0 | 1,202 | 0 | 0 | 0 | 0 | 0 | 41 | 159 |
d9adc9a9493e0f09aeeb88aa4a498de138b3d88f | 2,855 | py | Python | tests/python/pants_test/backend/codegen/grpcio/test_multiple_grpcio_gen.py | revl/pants | 8ad83e4ca80c095d44efceafd8b41e575da39c65 | [
"Apache-2.0"
] | 1 | 2021-05-05T18:58:28.000Z | 2021-05-05T18:58:28.000Z | tests/python/pants_test/backend/codegen/grpcio/test_multiple_grpcio_gen.py | revl/pants | 8ad83e4ca80c095d44efceafd8b41e575da39c65 | [
"Apache-2.0"
] | null | null | null | tests/python/pants_test/backend/codegen/grpcio/test_multiple_grpcio_gen.py | revl/pants | 8ad83e4ca80c095d44efceafd8b41e575da39c65 | [
"Apache-2.0"
] | 3 | 2020-06-30T08:28:13.000Z | 2021-07-28T09:35:57.000Z | # Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
| 32.078652 | 89 | 0.503327 | # Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from textwrap import dedent
from pants.backend.codegen.grpcio.python.python_grpcio_library import PythonGrpcioLibrary
from pants_test.backend.codegen.grpcio.grpcio_test_base import Grpcio... | 0 | 0 | 0 | 2,502 | 0 | 0 | 0 | 130 | 91 |
1ecb0448618534f2360c099c871c5d7b03866fc2 | 828 | py | Python | scratch/gpx-utils.py | KyleGW/gopro-dashboard-overlay | 0bc244dccfc0046e680876e91541de81c54f7477 | [
"MIT"
] | 26 | 2021-11-02T09:20:30.000Z | 2022-03-15T08:30:43.000Z | scratch/gpx-utils.py | KyleGW/gopro-dashboard-overlay | 0bc244dccfc0046e680876e91541de81c54f7477 | [
"MIT"
] | 26 | 2021-11-10T11:55:44.000Z | 2022-03-25T23:22:58.000Z | scratch/gpx-utils.py | KyleGW/gopro-dashboard-overlay | 0bc244dccfc0046e680876e91541de81c54f7477 | [
"MIT"
] | 5 | 2021-11-10T13:08:45.000Z | 2022-03-15T09:52:04.000Z | import argparse
from gopro_overlay.gpx import load_timeseries
from gopro_overlay.journey import Journey
from gopro_overlay.units import units
# ## -0.29363,51.39235,-0.26822,51.39963
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description="Various random utilities for GPX files",
... | 26.709677 | 75 | 0.684783 | import argparse
from gopro_overlay.gpx import load_timeseries
from gopro_overlay.journey import Journey
from gopro_overlay.units import units
# ## -0.29363,51.39235,-0.26822,51.39963
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description="Various random utilities for GPX files",
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
10f30e46f5a8494d18fc9c9ec3784f3b63a3b077 | 22 | py | Python | paws/config.py | slaclab/paws | 60cf9a554f646fd30be4aaee325bd0b86c6ace68 | [
"BSD-3-Clause-LBNL"
] | 2 | 2019-07-19T14:41:55.000Z | 2021-03-11T23:15:24.000Z | paws/config.py | slaclab/paws | 60cf9a554f646fd30be4aaee325bd0b86c6ace68 | [
"BSD-3-Clause-LBNL"
] | 11 | 2017-12-13T19:57:38.000Z | 2018-05-21T23:01:08.000Z | paws/config.py | slaclab/paws | 60cf9a554f646fd30be4aaee325bd0b86c6ace68 | [
"BSD-3-Clause-LBNL"
] | 4 | 2017-09-11T17:26:57.000Z | 2020-12-13T00:07:06.000Z | __version__='0.11.1'
| 7.333333 | 20 | 0.681818 | __version__='0.11.1'
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8572630d01c71cfee022a5cdca4509ea4e32a44a | 2,922 | py | Python | alarmsbot.py | rootweiller/bots_telegram | a0bc2d0b8afaeb66614dfdabe2ac770b8943c5ab | [
"Apache-2.0"
] | null | null | null | alarmsbot.py | rootweiller/bots_telegram | a0bc2d0b8afaeb66614dfdabe2ac770b8943c5ab | [
"Apache-2.0"
] | null | null | null | alarmsbot.py | rootweiller/bots_telegram | a0bc2d0b8afaeb66614dfdabe2ac770b8943c5ab | [
"Apache-2.0"
] | null | null | null | import telebot
import logging
TOKEN = 'TOKEN_HERE'
# Enable Logging
logging.basicConfig(
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
level=logging.INFO)
logger = logging.getLogger(__name__)
tb = telebot.TeleBot(TOKEN)
updates = tb.get_updates(1234,100,20)
last_chat_id = 0
user... | 22.476923 | 143 | 0.69165 | import telebot
from telebot import types
import logging
TOKEN = 'TOKEN_HERE'
# Enable Logging
logging.basicConfig(
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
level=logging.INFO)
logger = logging.getLogger(__name__)
tb = telebot.TeleBot(TOKEN)
updates = tb.get_updates(1234,100,2... | 0 | 1,268 | 0 | 44 | 0 | 668 | 0 | 4 | 206 |
0ae7a863a944b31f2cf68142fd05dca820018222 | 1,495 | py | Python | src/dataset.py | nhthang9x/Very-deep-cnn-pytorch | b82677420ffb02c6ddab8dd18b3b14945d4af27b | [
"MIT"
] | 15 | 2019-11-22T07:13:13.000Z | 2022-02-12T16:09:41.000Z | src/dataset.py | nhthang9x/Very-deep-cnn-pytorch | b82677420ffb02c6ddab8dd18b3b14945d4af27b | [
"MIT"
] | 1 | 2020-08-07T13:41:06.000Z | 2020-08-08T08:32:36.000Z | src/dataset.py | nhthang9x/Very-deep-cnn-pytorch | b82677420ffb02c6ddab8dd18b3b14945d4af27b | [
"MIT"
] | 5 | 2019-11-22T07:12:34.000Z | 2021-09-18T08:17:10.000Z | # -*- coding: utf-8 -*-
"""
@author: Viet Nguyen <nhviet1009@gmail.com>
"""
import sys
import csv
csv.field_size_limit(sys.maxsize)
| 32.5 | 108 | 0.559866 | # -*- coding: utf-8 -*-
"""
@author: Viet Nguyen <nhviet1009@gmail.com>
"""
import sys
import csv
import numpy as np
from torch.utils.data import Dataset
csv.field_size_limit(sys.maxsize)
class MyDataset(Dataset):
def __init__(self, data_path, max_length=1014):
self.data_path = data_path
self.voc... | 0 | 0 | 0 | 1,282 | 0 | 0 | 0 | 12 | 67 |
d5c3e8830c6ef06c3557a26fbec15a1197265bed | 4,309 | py | Python | bot_trainer/train.py | ml-ds-data/chiron | 3927d2ba5aab37aa20182b4f21f7a83f7c537b8d | [
"Apache-2.0"
] | 1 | 2021-01-04T15:20:56.000Z | 2021-01-04T15:20:56.000Z | bot_trainer/train.py | ml-ds-data/chiron | 3927d2ba5aab37aa20182b4f21f7a83f7c537b8d | [
"Apache-2.0"
] | null | null | null | bot_trainer/train.py | ml-ds-data/chiron | 3927d2ba5aab37aa20182b4f21f7a83f7c537b8d | [
"Apache-2.0"
] | null | null | null | import logging
import os
import yaml
from rasa.constants import DEFAULT_CONFIG_PATH, DEFAULT_DATA_PATH, DEFAULT_DOMAIN_PATH
from rasa.train import DEFAULT_MODELS_PATH
from rasa.train import train
from bot_trainer.data_processor.constant import MODEL_TRAINING_STATUS
from bot_trainer.data_processor.processor import Age... | 33.146154 | 104 | 0.692968 | import logging
import os
import tempfile
from contextlib import ExitStack
from typing import Text, Optional, Dict
import yaml
from rasa.constants import DEFAULT_CONFIG_PATH, DEFAULT_DATA_PATH, DEFAULT_DOMAIN_PATH
from rasa.importers.importer import TrainingDataImporter
from rasa.train import DEFAULT_MODELS_PATH
from r... | 0 | 0 | 1,503 | 0 | 0 | 0 | 0 | 180 | 178 |
4ef8be9a1e238801348410c65ac3b1b37343d0a3 | 1,852 | py | Python | src/robot/result/suiteteardownfailed.py | silviot/bryanoakley-robotframework-linenumbers | 7cc85c1cb8bdbf63d3bb6721ad1ddf8d9420d85e | [
"ECL-2.0",
"Apache-2.0"
] | 4 | 2016-02-29T17:00:24.000Z | 2019-06-27T08:49:13.000Z | lib/robot/result/suiteteardownfailed.py | nbbull/RIDE | e6496f0b1b6dc454b9479de48b6949bce29b53df | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | lib/robot/result/suiteteardownfailed.py | nbbull/RIDE | e6496f0b1b6dc454b9479de48b6949bce29b53df | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2017-10-30T06:34:47.000Z | 2019-03-12T07:23:08.000Z | # Copyright 2008-2012 Nokia Siemens Networks Oyj
#
# 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... | 30.866667 | 76 | 0.703564 | # Copyright 2008-2012 Nokia Siemens Networks Oyj
#
# 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... | 0 | 0 | 0 | 1,161 | 0 | 0 | 0 | 15 | 69 |
8634090dd3d74febcb24a99cf262eb19e5094580 | 9,192 | py | Python | Src/MonteCarlo/method_check.py | jomimc/imperfect_fifths | 486608da65816e5ac70a33dbdd659c260905c52e | [
"MIT"
] | null | null | null | Src/MonteCarlo/method_check.py | jomimc/imperfect_fifths | 486608da65816e5ac70a33dbdd659c260905c52e | [
"MIT"
] | null | null | null | Src/MonteCarlo/method_check.py | jomimc/imperfect_fifths | 486608da65816e5ac70a33dbdd659c260905c52e | [
"MIT"
] | null | null | null | import argparse
import glob
import os
import time
import pickle
import multiprocessing as mp
import numpy as np
import pandas as pd
import utils
# PATHS
SRC_DIR = '/home/jmcbride/Scales/Toy_model/Src'
DATA_DIR = '/home/jmcbride/Scales/Toy_model/Data/Raw_tmp4'
DATA_DIR_2 = '/home/jmcbride/Scales/Toy_model/Data/Raw4'
... | 34.426966 | 315 | 0.611728 | import argparse
import glob
import os
import sys
import time
import pickle
from itertools import product
import matplotlib.pyplot as plt
import multiprocessing as mp
import numpy as np
import pandas as pd
import seaborn as sns
import utils
from bias_beta import BETA_BIAS
# PATHS
SRC_DIR = '/home/jmcbride/Scales/Toy_... | 0 | 0 | 0 | 0 | 0 | 4,516 | 0 | 17 | 364 |
b184ddc542d82b31fe31588b55043316020cac5d | 458 | py | Python | site_scons/site_tools/talk_noops.py | MIPS/external-chromium_org-third_party-libjingle-source-talk | 06a093c73d10bd918baa95312974108bf37b54b4 | [
"BSL-1.0",
"BSD-3-Clause"
] | null | null | null | site_scons/site_tools/talk_noops.py | MIPS/external-chromium_org-third_party-libjingle-source-talk | 06a093c73d10bd918baa95312974108bf37b54b4 | [
"BSL-1.0",
"BSD-3-Clause"
] | null | null | null | site_scons/site_tools/talk_noops.py | MIPS/external-chromium_org-third_party-libjingle-source-talk | 06a093c73d10bd918baa95312974108bf37b54b4 | [
"BSL-1.0",
"BSD-3-Clause"
] | null | null | null | # Copyright 2010 Google Inc.
# All Rights Reserved.
# Author: thaloun@google.com (Tim Haloun)
"""Noop tool that defines builder functions for non-default platforms to
avoid errors when scanning sconsscripts."""
import SCons.Builder
def generate(env):
"""SCons method."""
if not env.Bit('windows'):
builder... | 21.809524 | 72 | 0.689956 | # Copyright 2010 Google Inc.
# All Rights Reserved.
# Author: thaloun@google.com (Tim Haloun)
"""Noop tool that defines builder functions for non-default platforms to
avoid errors when scanning sconsscripts."""
import SCons.Builder
def generate(env):
"""SCons method."""
if not env.Bit('windows'):
builder... | 0 | 0 | 0 | 0 | 0 | 8 | 0 | 0 | 23 |
54728432a92e656dee54e0ac4aebfb5adf722eed | 1,446 | py | Python | src/simple_commander/utils/constants.py | peterzdeb/WebGamepad | 62e55513803d1afbdf5a6a4e3a3757dcdd3e3449 | [
"MIT"
] | null | null | null | src/simple_commander/utils/constants.py | peterzdeb/WebGamepad | 62e55513803d1afbdf5a6a4e3a3757dcdd3e3449 | [
"MIT"
] | null | null | null | src/simple_commander/utils/constants.py | peterzdeb/WebGamepad | 62e55513803d1afbdf5a6a4e3a3757dcdd3e3449 | [
"MIT"
] | null | null | null | """ This module contains list of constant variables. """
ANGLE = 2
ACTION_INTERVAL = 0.05
DEFAULT_LIFE_COUNT = 5
DEFAULT_SPEED = 35
DEFAULT_SPEED_BULLETS = 120
MAX_ANGLE = 360
MAX_SPEED = 220
ROTATION_ANGLE = 0.015
SPEED = 8
STEP_INTERVAL = 1 # 1 second, can be changed to 0.5
UNIT_PROPERTIES = ['x', 'y', 'x1', 'y1',... | 43.818182 | 121 | 0.521438 | """ This module contains list of constant variables. """
ANGLE = 2
ACTION_INTERVAL = 0.05
DEFAULT_LIFE_COUNT = 5
DEFAULT_SPEED = 35
DEFAULT_SPEED_BULLETS = 120
MAX_ANGLE = 360
MAX_SPEED = 220
ROTATION_ANGLE = 0.015
SPEED = 8
STEP_INTERVAL = 1 # 1 second, can be changed to 0.5
UNIT_PROPERTIES = ['x', 'y', 'x1', 'y1',... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
41570b1077662a4b8088a31b4fb6e311454828a9 | 361 | py | Python | applications/structural_application/test_examples/cantilever2d.gid/cantilever2ddynamic_build_reference.py | AndreaVoltan/MyKratos7.0 | e977752722e8ef1b606f25618c4bf8fd04c434cc | [
"BSD-4-Clause"
] | 2 | 2020-04-30T19:13:08.000Z | 2021-04-14T19:40:47.000Z | applications/structural_application/test_examples/cantilever2d.gid/cantilever2ddynamic_build_reference.py | AndreaVoltan/MyKratos7.0 | e977752722e8ef1b606f25618c4bf8fd04c434cc | [
"BSD-4-Clause"
] | 1 | 2020-04-30T19:19:09.000Z | 2020-05-02T14:22:36.000Z | applications/structural_application/test_examples/cantilever2d.gid/cantilever2ddynamic_build_reference.py | AndreaVoltan/MyKratos7.0 | e977752722e8ef1b606f25618c4bf8fd04c434cc | [
"BSD-4-Clause"
] | 1 | 2020-06-12T08:51:24.000Z | 2020-06-12T08:51:24.000Z | from __future__ import print_function, absolute_import, division #makes KratosMultiphysics backward compatible with python 2.6 and 2.7
import sys
kratos_benchmarking_path = '../../../../benchmarking'
sys.path.append(kratos_benchmarking_path)
import benchmarking
benchmarking.BuildReferenceData("cantilever2ddynamic_benc... | 45.125 | 134 | 0.833795 | from __future__ import print_function, absolute_import, division #makes KratosMultiphysics backward compatible with python 2.6 and 2.7
import sys
kratos_benchmarking_path = '../../../../benchmarking'
sys.path.append(kratos_benchmarking_path)
import benchmarking
benchmarking.BuildReferenceData("cantilever2ddynamic_benc... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7c3c3fa3e92903ebe8d5aaa0127d9b7df8cd6a0c | 56,834 | py | Python | gluon/scheduler.py | pav0n/web2py_ohka | 2d8302e4d1bffc8c845f9e37638a86bb691a8107 | [
"BSD-3-Clause"
] | null | null | null | gluon/scheduler.py | pav0n/web2py_ohka | 2d8302e4d1bffc8c845f9e37638a86bb691a8107 | [
"BSD-3-Clause"
] | null | null | null | gluon/scheduler.py | pav0n/web2py_ohka | 2d8302e4d1bffc8c845f9e37638a86bb691a8107 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
| This file is part of the web2py Web Framework
| Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>
| License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
Background processes made simple
---------------------------------
"""
USAGE = """
## Example
For an... | 37.588624 | 123 | 0.552117 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
| This file is part of the web2py Web Framework
| Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>
| License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
Background processes made simple
---------------------------------
"""
USAGE = """
## Example
For an... | 0 | 0 | 0 | 46,824 | 0 | 513 | 0 | 0 | 211 |
831764ebdf6e27be4d2d081a72cc7c62940dcace | 3,062 | py | Python | Level_Routines/Mechanics/RangedAttack.py | sidav/ShadowPriest | 0ab3f9e4dde03237dff7389d0654112f1d1994e9 | [
"MIT"
] | 1 | 2017-12-12T15:34:54.000Z | 2017-12-12T15:34:54.000Z | Level_Routines/Mechanics/RangedAttack.py | sidav/ShadowPriest | 0ab3f9e4dde03237dff7389d0654112f1d1994e9 | [
"MIT"
] | null | null | null | Level_Routines/Mechanics/RangedAttack.py | sidav/ShadowPriest | 0ab3f9e4dde03237dff7389d0654112f1d1994e9 | [
"MIT"
] | null | null | null |
# The next two methods maybe should be moved to some controller!
| 34.022222 | 120 | 0.683214 | from ..Units.Unit import Unit
from Message_Log import MessageLog as LOG
from . import Damage as DMG
from Routines import SidavLOS as LOS, TdlConsoleWrapper as CW, SidavRandom as RAND
from ..Controllers import LevelController as LC
def try_to_shoot(attacker:Unit, victim:Unit):
a_x, a_y = attacker.get_position()
... | 0 | 0 | 0 | 0 | 0 | 2,644 | 0 | 121 | 225 |
aa5490346279a3e42a202db7bf540b380da124d2 | 1,245 | py | Python | python-to-db/sql-alchemy.py | joonjCode/python | 92889be7c03ce6d3faa1401d34619295cf5d1ce4 | [
"MIT"
] | null | null | null | python-to-db/sql-alchemy.py | joonjCode/python | 92889be7c03ce6d3faa1401d34619295cf5d1ce4 | [
"MIT"
] | null | null | null | python-to-db/sql-alchemy.py | joonjCode/python | 92889be7c03ce6d3faa1401d34619295cf5d1ce4 | [
"MIT"
] | null | null | null | from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
# @dataclass
# movie1 = Movie(name = 'interstellar', genre='sf')
# print(movie1)
data = [{
'name':'interstellar',
'genre':'sf'
},{
'name':'The martian',
... | 21.465517 | 60 | 0.704418 | from dataclasses import dataclass
import sqlalchemy
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy import Column, Integer, String
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
# @dataclass
class Movie(Base):
# create table
__tablename_... | 0 | 0 | 0 | 449 | 0 | 0 | 0 | 33 | 88 |
b2a301da4074de6f27c961d47c9fdb0d4c7ee101 | 3,124 | py | Python | triflow/core/routines.py | locie/triflow | c8bc2ed48d1d1b389431abbfba42624866f95398 | [
"MIT"
] | 8 | 2017-06-01T16:05:53.000Z | 2018-10-18T10:02:50.000Z | triflow/core/routines.py | celliern/triflow | c8bc2ed48d1d1b389431abbfba42624866f95398 | [
"MIT"
] | 2 | 2019-04-13T08:57:33.000Z | 2019-05-19T17:50:54.000Z | triflow/core/routines.py | locie/triflow | c8bc2ed48d1d1b389431abbfba42624866f95398 | [
"MIT"
] | 1 | 2018-09-18T13:17:13.000Z | 2018-09-18T13:17:13.000Z | #!/usr/bin/env python
# coding=utf8
| 33.956522 | 169 | 0.575864 | #!/usr/bin/env python
# coding=utf8
import numpy as np
import sympy as sp
class ModelRoutine:
def __init__(self, matrix, args, pars, ufunc,
reduced=False):
self.pars = list(pars) + ['periodic']
self.matrix = matrix
self.args = args
self._ufunc = ufunc
def __r... | 0 | 0 | 0 | 2,977 | 0 | 0 | 0 | -6 | 114 |
3bc6f9dab17d1d3a897cde42261917d10c279f64 | 567 | py | Python | llvmpy/src/Support/CodeGen.py | KennethNielsen/llvmpy | 70c5957cfd10f1e32a44f28dcb9a4dc72d499c2e | [
"BSD-3-Clause"
] | 140 | 2015-01-07T20:58:12.000Z | 2022-01-21T17:02:21.000Z | llvmpy/src/Support/CodeGen.py | pfalcon/llvmpy | 2338eae5f6a91651125b8180abafa8c9afaa90d8 | [
"BSD-3-Clause"
] | 19 | 2015-01-15T14:45:49.000Z | 2020-09-04T14:58:23.000Z | llvmpy/src/Support/CodeGen.py | pfalcon/llvmpy | 2338eae5f6a91651125b8180abafa8c9afaa90d8 | [
"BSD-3-Clause"
] | 12 | 2015-01-12T01:49:32.000Z | 2020-07-10T22:30:38.000Z | from ..namespace import llvm
Reloc = llvm.Namespace('Reloc')
Reloc.Enum('Model',
'Default', 'Static', 'PIC_', 'DynamicNoPIC')
CodeModel = llvm.Namespace('CodeModel')
CodeModel.Enum('Model',
'Default', 'JITDefault', 'Small', 'Kernel', 'Medium', 'Large')
TLSModel = llvm.Namespace('TLSModel')... | 27 | 77 | 0.640212 | from binding import *
from ..namespace import llvm
Reloc = llvm.Namespace('Reloc')
Reloc.Enum('Model',
'Default', 'Static', 'PIC_', 'DynamicNoPIC')
CodeModel = llvm.Namespace('CodeModel')
CodeModel.Enum('Model',
'Default', 'JITDefault', 'Small', 'Kernel', 'Medium', 'Large')
TLSModel = llvm... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 22 |
ddf3f750defa688318851ae4404775a9d7fed00c | 42 | py | Python | pytest_headlock/common.py | mrh1997/pytest-headlock | a7513ed4067d3a3ddd53182e590ec150688d5010 | [
"MIT"
] | 2 | 2017-11-09T13:49:57.000Z | 2020-03-07T01:29:37.000Z | pytest_headlock/common.py | mrh1997/pytest-headlock | a7513ed4067d3a3ddd53182e590ec150688d5010 | [
"MIT"
] | 4 | 2017-12-22T12:27:34.000Z | 2020-03-31T07:42:07.000Z | headlock/integrations/pytest/common.py | mrh1997/headlock | 720ede7e02681d6466b27ae7fb3958ef8c4a238c | [
"MIT"
] | null | null | null |
PYTEST_HEADLOCK_DIR = '.pytest-headlock'
| 14 | 40 | 0.785714 |
PYTEST_HEADLOCK_DIR = '.pytest-headlock'
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7f17a48cac5995385377dd40a7f353f6930827da | 1,378 | py | Python | sauna/reload/__init__.py | esamattis/sauna.reload | f91c03e7061a0741961bcfb0ad5da18481a9e7d9 | [
"ZPL-2.1"
] | 1 | 2019-01-17T09:07:24.000Z | 2019-01-17T09:07:24.000Z | sauna/reload/__init__.py | epeli/sauna.reload | f91c03e7061a0741961bcfb0ad5da18481a9e7d9 | [
"ZPL-2.1"
] | null | null | null | sauna/reload/__init__.py | epeli/sauna.reload | f91c03e7061a0741961bcfb0ad5da18481a9e7d9 | [
"ZPL-2.1"
] | 10 | 2016-02-10T20:18:36.000Z | 2018-11-28T12:16:10.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2011 University of Jyvskyl and Contributors.
#
# All Rights Reserved.
#
# Authors:
# Esa-Matti Suuronen <esa-matti@suuronen.org>
# Asko Soukka <asko.soukka@iki.fi>
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of t... | 29.956522 | 75 | 0.748911 | # -*- coding: utf-8 -*-
# Copyright (c) 2011 University of Jyväskylä and Contributors.
#
# All Rights Reserved.
#
# Authors:
# Esa-Matti Suuronen <esa-matti@suuronen.org>
# Asko Soukka <asko.soukka@iki.fi>
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of... | 4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
86f57c61de33e2ff81402d30ae68af0956fed92e | 1,003 | py | Python | src/simulation2.py | emilybache/PipelineSimulation | c931df82eba3a851c33c5c98f26ef80cf86e6798 | [
"MIT"
] | 3 | 2018-06-15T09:07:52.000Z | 2020-01-03T10:35:20.000Z | src/simulation2.py | emilybache/PipelineSimulation | c931df82eba3a851c33c5c98f26ef80cf86e6798 | [
"MIT"
] | null | null | null | src/simulation2.py | emilybache/PipelineSimulation | c931df82eba3a851c33c5c98f26ef80cf86e6798 | [
"MIT"
] | 1 | 2018-06-14T03:49:21.000Z | 2018-06-14T03:49:21.000Z | from datetime import datetime, timedelta
from commits import generate_commits
from deploy import DeployPolicy, Deployer
from export import print_metrics
from metrics import pipeline_metrics
from simulation import run_simulation, print_runs
from stages import Stage
stages = [
Stage("Build & Unit Test", duration=t... | 35.821429 | 105 | 0.797607 | from datetime import datetime, timedelta
from commits import generate_commits
from deploy import DeployPolicy, Deployer
from export import print_metrics
from metrics import pipeline_metrics
from simulation import run_simulation, print_runs
from stages import Stage
stages = [
Stage("Build & Unit Test", duration=t... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9da7f052fce3ad60e2e779727102f417b5ea4f9c | 2,344 | py | Python | Buy/get_bizz.py | cstacho/bloom | cf0158fe68bb55e9a32731c9d0aef3d3af10eab3 | [
"Apache-2.0"
] | null | null | null | Buy/get_bizz.py | cstacho/bloom | cf0158fe68bb55e9a32731c9d0aef3d3af10eab3 | [
"Apache-2.0"
] | null | null | null | Buy/get_bizz.py | cstacho/bloom | cf0158fe68bb55e9a32731c9d0aef3d3af10eab3 | [
"Apache-2.0"
] | null | null | null | bizz = {
"clothing": {
"Aerie": " Aerie focuses on intimates and swimwear for teens and young women. But Aerie has one big difference that makes it stand out from competitors: It was the first major brand to ban Photoshop in ad campaigns and deviate from the prototypical model in favor of average wo... | 80.827586 | 337 | 0.720563 | import random
bizz = {
"clothing": {
"Aerie": " Aerie focuses on intimates and swimwear for teens and young women. But Aerie has one big difference that makes it stand out from competitors: It was the first major brand to ban Photoshop in ad campaigns and deviate from the prototypical model in favor... | 6 | 0 | 0 | 0 | 0 | 105 | 0 | -8 | 98 |
7cef10076385b436a84b7ce12171e056a332ab59 | 103,052 | py | Python | pattern/db/__init__.py | nitsuga1986/pattern | 17f215438166729114762c3d9b3179dacd31490d | [
"BSD-3-Clause"
] | null | null | null | pattern/db/__init__.py | nitsuga1986/pattern | 17f215438166729114762c3d9b3179dacd31490d | [
"BSD-3-Clause"
] | null | null | null | pattern/db/__init__.py | nitsuga1986/pattern | 17f215438166729114762c3d9b3179dacd31490d | [
"BSD-3-Clause"
] | null | null | null | #### PATTERN | DB ##################################################################################
# -*- coding: utf-8 -*-
# Copyright (c) 2010 University of Antwerp, Belgium
# Author: Tom De Smedt <tom@organisms.be>
# License: BSD (see LICENSE.txt for details).
# http://www.clips.ua.ac.be/pages/pattern
############... | 37.610219 | 139 | 0.562153 | #### PATTERN | DB ##################################################################################
# -*- coding: utf-8 -*-
# Copyright (c) 2010 University of Antwerp, Belgium
# Author: Tom De Smedt <tom@organisms.be>
# License: BSD (see LICENSE.txt for details).
# http://www.clips.ua.ac.be/pages/pattern
############... | 4 | 6,207 | 0 | 62,683 | 131 | 2,445 | 0 | 78 | 1,453 |
ed25cc431b5b8d93eb034bb91ba82f60ca08505f | 1,235 | py | Python | dm_page/migrations/0088_auto_20211022_1648.py | AlexanderHalsey/Donation-Manager | 5655d1eb6394f7db9a178c081039c4e149ef6998 | [
"Unlicense"
] | null | null | null | dm_page/migrations/0088_auto_20211022_1648.py | AlexanderHalsey/Donation-Manager | 5655d1eb6394f7db9a178c081039c4e149ef6998 | [
"Unlicense"
] | null | null | null | dm_page/migrations/0088_auto_20211022_1648.py | AlexanderHalsey/Donation-Manager | 5655d1eb6394f7db9a178c081039c4e149ef6998 | [
"Unlicense"
] | null | null | null | # Generated by Django 3.1.7 on 2021-10-22 16:48
| 32.5 | 100 | 0.59919 | # Generated by Django 3.1.7 on 2021-10-22 16:48
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dm_page', '0087_auto_20211019_1256'),
]
operations = [
migrations.AlterModelOptions(
name='paymentmode',
options={'v... | 10 | 0 | 0 | 1,116 | 0 | 0 | 0 | 19 | 46 |
0b218ce43a7abb9df2476e21de9ac80ae18caa10 | 2,428 | py | Python | CNN_graph_embedding.py | tindr-project/graph-based_network | 9b7f5be6fe43e697ebe9299b403bb17d5b0fd7d5 | [
"MIT"
] | 3 | 2019-01-14T14:40:01.000Z | 2019-12-24T01:59:48.000Z | CNN_graph_embedding.py | tindr-project/graph-based_network | 9b7f5be6fe43e697ebe9299b403bb17d5b0fd7d5 | [
"MIT"
] | null | null | null | CNN_graph_embedding.py | tindr-project/graph-based_network | 9b7f5be6fe43e697ebe9299b403bb17d5b0fd7d5 | [
"MIT"
] | 1 | 2021-11-04T03:14:22.000Z | 2021-11-04T03:14:22.000Z | # Copyright 2018 H. Gaspar hagax8@gmail.com
| 37.9375 | 101 | 0.653624 | # Copyright 2018 H. Gaspar hagax8@gmail.com
import numpy as np
import keras
import keras.backend as K
from keras.layers import Input, Dense, Activation, ZeroPadding2D, BatchNormalization, Flatten, Conv2D
from keras.layers import MaxPooling2D
from keras.models import Model
from IPython.display import SVG
from keras.util... | 0 | 0 | 0 | 0 | 0 | 1,825 | 0 | 223 | 333 |
d61b4ce6c0250874d7e5430edc32ade8df911844 | 6,051 | py | Python | tuprolog/solve/primitive/__init__.py | DavideEva/2ppy | 55609415102f8116165a42c8e33e029c4906e160 | [
"Apache-2.0"
] | 1 | 2021-08-07T06:29:28.000Z | 2021-08-07T06:29:28.000Z | tuprolog/solve/primitive/__init__.py | DavideEva/2ppy | 55609415102f8116165a42c8e33e029c4906e160 | [
"Apache-2.0"
] | 14 | 2021-09-16T13:25:12.000Z | 2022-01-03T10:12:22.000Z | tuprolog/solve/primitive/__init__.py | DavideEva/2ppy | 55609415102f8116165a42c8e33e029c4906e160 | [
"Apache-2.0"
] | 1 | 2021-12-22T00:25:32.000Z | 2021-12-22T00:25:32.000Z | from tuprolog import logger
# noinspection PyUnresolvedReferences
# from tuprolog.solve.sideffcts import SideEffect
# noinspection PyUnresolvedReferences
import it.unibo.tuprolog.solve.primitive as _primitive
Primitive = _primitive.Primitive
Solve = _primitive.Solve
PrimitiveWrapper = _primitive.PrimitiveWrapper
S... | 37.122699 | 111 | 0.813254 | from tuprolog import logger
# noinspection PyUnresolvedReferences
import jpype.imports
from tuprolog.core import Term, Clause, Integer
from tuprolog.solve import ExecutionContext, Signature, Solution, current_time_instant, MAX_TIMEOUT
# from tuprolog.solve.sideffcts import SideEffect
from tuprolog.pyutils import iterab... | 0 | 169 | 0 | 143 | 0 | 4,240 | 0 | 166 | 845 |
4fb5d21d1239e2ff1bc0db147d6f42b16b81640d | 2,646 | py | Python | pruebas/no_test.py | arturoless/open1 | 6444572def6428c6bebac18487b010af2ef6ba26 | [
"MIT"
] | null | null | null | pruebas/no_test.py | arturoless/open1 | 6444572def6428c6bebac18487b010af2ef6ba26 | [
"MIT"
] | null | null | null | pruebas/no_test.py | arturoless/open1 | 6444572def6428c6bebac18487b010af2ef6ba26 | [
"MIT"
] | null | null | null | import cv2
import numpy as np
import repair_last as rp
global find
find=False
global mejor_x_inicial
mejor_x_inicial = 0
global mejor_y_inicial
mejor_y_inicial = 0
# global resultado1
# resultado1=[]
# global resultado2
# resultado2=[]
# global resultado3
# resultado3=[]
# global resultado4
# resultado4=[]
pathIn ... | 25.68932 | 152 | 0.633787 | import cv2
import sys
import numpy as np
import threading
import repair_last as rp
global find
find=False
global mejor_x_inicial
mejor_x_inicial = 0
global mejor_y_inicial
mejor_y_inicial = 0
# global resultado1
# resultado1=[]
# global resultado2
# resultado2=[]
# global resultado3
# resultado3=[]
# global resultado... | 0 | 0 | 0 | 0 | 0 | 976 | 0 | -16 | 68 |
17c382ecab87460afce6122cd9ed83d993131798 | 2,355 | py | Python | lib/db.py | qvant/achivement_bot | 1d91243df5549123c7b54f1aec6e6b837bf68db8 | [
"MIT"
] | null | null | null | lib/db.py | qvant/achivement_bot | 1d91243df5549123c7b54f1aec6e6b837bf68db8 | [
"MIT"
] | null | null | null | lib/db.py | qvant/achivement_bot | 1d91243df5549123c7b54f1aec6e6b837bf68db8 | [
"MIT"
] | null | null | null |
global load_log
| 37.380952 | 106 | 0.676008 | from typing import Union
import psycopg2
from lib.config import Config, MODE_WORKER
from lib.platform import Platform
from lib.platforms.steam import init_platform as init_steam
from lib.platforms.retroachievements import init_platform as init_retro
from lib.player import STATUS_VALID, Player
from .log import get_log... | 0 | 0 | 0 | 0 | 0 | 1,942 | 0 | 146 | 247 |
deb282d7a131bff9da87a4816f270e27fc840824 | 1,731 | py | Python | pineboolib/q3widgets/spinbox.py | Aulla/pineboo | 3ad6412d365a6ad65c3bb2bdc03f5798d7c37004 | [
"MIT"
] | 2 | 2017-12-10T23:06:16.000Z | 2017-12-10T23:06:23.000Z | pineboolib/q3widgets/spinbox.py | Aulla/pineboo | 3ad6412d365a6ad65c3bb2bdc03f5798d7c37004 | [
"MIT"
] | 36 | 2017-11-05T21:13:47.000Z | 2020-08-26T15:56:15.000Z | pineboolib/q3widgets/spinbox.py | Aulla/pineboo | 3ad6412d365a6ad65c3bb2bdc03f5798d7c37004 | [
"MIT"
] | 8 | 2017-11-05T15:56:31.000Z | 2019-04-25T16:32:28.000Z | """Spinbox module."""
| 27.47619 | 87 | 0.60543 | """Spinbox module."""
from PyQt6 import QtWidgets # type: ignore[import]
class SpinBox(QtWidgets.QWidget):
"""SpinBox class."""
_label: "QtWidgets.QLabel"
_spin_box: "QtWidgets.QSpinBox"
_lay: "QtWidgets.QHBoxLayout"
def __init__(self, parent=None):
"""Initialize."""
super()._... | 0 | 0 | 0 | 1,632 | 0 | 0 | 0 | 6 | 70 |
23dab0c8ec29242ddede44d0f786aa4c32e8fe52 | 784 | py | Python | casepro/msgs/migrations/0046_exports_partner.py | rapidpro/ureport-partners | 16e5b95eae36ecbbe8ab2a59f34a2f5fd32ceacd | [
"BSD-3-Clause"
] | 21 | 2015-07-21T15:57:49.000Z | 2021-11-04T18:26:35.000Z | casepro/msgs/migrations/0046_exports_partner.py | rapidpro/ureport-partners | 16e5b95eae36ecbbe8ab2a59f34a2f5fd32ceacd | [
"BSD-3-Clause"
] | 357 | 2015-05-22T07:26:45.000Z | 2022-03-12T01:08:28.000Z | casepro/msgs/migrations/0046_exports_partner.py | rapidpro/ureport-partners | 16e5b95eae36ecbbe8ab2a59f34a2f5fd32ceacd | [
"BSD-3-Clause"
] | 24 | 2015-05-28T12:30:25.000Z | 2021-11-19T01:57:38.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
| 29.037037 | 102 | 0.593112 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("cases", "0036_caseexport_partner"), ("msgs", "0045_replyexport")]
operations = [
migrations.AddField(
model_name="messageexpo... | 0 | 0 | 0 | 654 | 0 | 0 | 0 | 19 | 46 |
75330a1c54c821804dd047edbb91329b755e606f | 1,325 | py | Python | ip_generator.py | bbhunter/security-tools | 920ae2ff63c7411ebba527d6223faad9ba672026 | [
"MIT"
] | 627 | 2015-03-20T07:09:33.000Z | 2022-03-31T09:29:17.000Z | ip_generator.py | FingerLeakers/security-tools | 7537294b17abc5ff219d745c0829aa10d945c5ca | [
"MIT"
] | 29 | 2015-02-18T22:26:29.000Z | 2022-01-16T19:59:58.000Z | ip_generator.py | FingerLeakers/security-tools | 7537294b17abc5ff219d745c0829aa10d945c5ca | [
"MIT"
] | 171 | 2015-04-23T14:38:03.000Z | 2022-03-23T06:19:40.000Z | #!/usr/bin/env python
# generates list of IP addresses from range IP start - IP stop
#
import sys
usage = """
### IP range address generator
### by bl4de | twiiter.com/_bl4de | hackerone.com/bl4de | github.com/bl4de
Generates list of IP addresses, starting from IP passed as first argument and ended up with
IP addres... | 28.191489 | 100 | 0.580377 | #!/usr/bin/env python
# generates list of IP addresses from range IP start - IP stop
#
import sys
usage = """
### IP range address generator
### by bl4de | twiiter.com/_bl4de | hackerone.com/bl4de | github.com/bl4de
Generates list of IP addresses, starting from IP passed as first argument and ended up with
IP addres... | 0 | 0 | 0 | 0 | 0 | 421 | 0 | 0 | 46 |
1dded91890a29f16e63d02c65f194a91fcde046e | 8,055 | py | Python | bin/MCMC_fitter_simple.py | desihub/desidithering | 71bc27e73f959fadbfe79ab718a9f1b6264e37bd | [
"BSD-3-Clause"
] | null | null | null | bin/MCMC_fitter_simple.py | desihub/desidithering | 71bc27e73f959fadbfe79ab718a9f1b6264e37bd | [
"BSD-3-Clause"
] | 5 | 2017-10-30T23:31:10.000Z | 2019-03-05T20:05:09.000Z | bin/MCMC_fitter_simple.py | desihub/desidithering | 71bc27e73f959fadbfe79ab718a9f1b6264e37bd | [
"BSD-3-Clause"
] | null | null | null |
import argparse
import time
import matplotlib as mpl
mpl.use("agg")
from astropy.io import fits
#from emcee.utils import MPIPool
#from pathos.multiprocessing import Pool
debug = True
num_dithers = None
if __name__=="__main__":
parser = argparse.ArgumentParser(description="Script to run MCMC fitter on the simu... | 38.725962 | 119 | 0.637741 |
import argparse
import time
import matplotlib as mpl
mpl.use("agg")
import numpy
import matplotlib.pyplot as plt
import emcee
import corner
import math
import sys
import pickle
from multiprocessing import Pool
from astropy.io import fits
#from emcee.utils import MPIPool
#from pathos.multiprocessing import Pool
de... | 0 | 0 | 0 | 0 | 0 | 5,558 | 0 | -34 | 432 |
4a6b3c5ac0f740fc33af2f028169bdb5cfaa0a24 | 546 | py | Python | python/20190126/Code/c5.py | Realize0917/career | b5d02ac53cfc3ce3a2ca38d11480c51560283e67 | [
"MIT"
] | 3 | 2019-01-17T05:50:51.000Z | 2019-03-15T10:10:07.000Z | python/20190126/Code/c5.py | Realize0917/career | b5d02ac53cfc3ce3a2ca38d11480c51560283e67 | [
"MIT"
] | 10 | 2019-01-17T06:07:03.000Z | 2019-02-19T05:55:25.000Z | python/20190126/Code/c5.py | Realize0917/career | b5d02ac53cfc3ce3a2ca38d11480c51560283e67 | [
"MIT"
] | 4 | 2018-12-22T07:32:55.000Z | 2019-03-06T09:13:48.000Z | """
threading
"""
import threading
from threading import Thread
print('thread %s is run...' % threading.current_thread().name)
t = Thread(target=loop, name='LoopThread')
t.start()
t.join() #
print('thread %s done' % threading.current_thread().name)
| 22.75 | 72 | 0.635531 | """
多线程
threading
"""
import threading, time
from threading import Thread
def loop():
print('thread %s is running' % threading.current_thread().name)
n = 0
while n < 5:
n += 1
print('thread %s >>> %s' % (threading.current_thread().name, n))
time.sleep(1)
print('thread %s done.' ... | 15 | 0 | 0 | 0 | 0 | 258 | 0 | 6 | 23 |
318364cedf7a9060147ce29a35eaf54a2e73fc6b | 3,870 | py | Python | tensorforce/core/memories/latest.py | philipshurpik/tensorforce | 0a30b4a4171fd279fc48a539d74dbd3153aafd9d | [
"Apache-2.0"
] | 1 | 2019-05-18T07:22:09.000Z | 2019-05-18T07:22:09.000Z | tensorforce/core/memories/latest.py | philipshurpik/tensorforce | 0a30b4a4171fd279fc48a539d74dbd3153aafd9d | [
"Apache-2.0"
] | null | null | null | tensorforce/core/memories/latest.py | philipshurpik/tensorforce | 0a30b4a4171fd279fc48a539d74dbd3153aafd9d | [
"Apache-2.0"
] | 1 | 2021-03-22T07:31:13.000Z | 2021-03-22T07:31:13.000Z | # Copyright 2017 reinforce.io. 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... | 45.529412 | 163 | 0.663307 | # Copyright 2017 reinforce.io. 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... | 0 | 0 | 0 | 2,987 | 0 | 0 | 0 | 24 | 69 |
c497c07ed2cb84452c75f61013d023649e7e4246 | 367 | py | Python | moe/tests/bandit/ucb/__init__.py | dstoeckel/MOE | 5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c | [
"Apache-2.0"
] | 966 | 2015-01-10T05:27:30.000Z | 2022-03-26T21:04:36.000Z | moe/tests/bandit/ucb/__init__.py | dstoeckel/MOE | 5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c | [
"Apache-2.0"
] | 46 | 2015-01-16T22:33:08.000Z | 2019-09-04T16:33:27.000Z | moe/tests/bandit/ucb/__init__.py | dstoeckel/MOE | 5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c | [
"Apache-2.0"
] | 143 | 2015-01-07T03:57:19.000Z | 2022-02-28T01:10:45.000Z | # -*- coding: utf-8 -*-
"""Testing code for the (Python) UCB bandit policies.
**Files in this package**
* :mod:`moe.tests.bandit.ucb.ucb_test_case`: base test case for UCB tests
* :mod:`moe.tests.bandit.ucb.ucb1_test`: tests for :mod:`moe.bandit.ucb.ucb1.UCB1`
* :mod:`moe.tests.bandit.ucb.ucb1_tuned_test`: tests for :... | 36.7 | 99 | 0.711172 | # -*- coding: utf-8 -*-
"""Testing code for the (Python) UCB bandit policies.
**Files in this package**
* :mod:`moe.tests.bandit.ucb.ucb_test_case`: base test case for UCB tests
* :mod:`moe.tests.bandit.ucb.ucb1_test`: tests for :mod:`moe.bandit.ucb.ucb1.UCB1`
* :mod:`moe.tests.bandit.ucb.ucb1_tuned_test`: tests for :... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b99494edec91a74de959e21393902289a2bbae6b | 3,995 | py | Python | Rental Car.py | CrossJonathan27/Rental-Car-billing-Script | e3b192ebc6e60f5921e8e920e200240509c1187f | [
"MIT"
] | null | null | null | Rental Car.py | CrossJonathan27/Rental-Car-billing-Script | e3b192ebc6e60f5921e8e920e200240509c1187f | [
"MIT"
] | null | null | null | Rental Car.py | CrossJonathan27/Rental-Car-billing-Script | e3b192ebc6e60f5921e8e920e200240509c1187f | [
"MIT"
] | null | null | null |
#this code asks the user to input the rental code B, D, or W. as well as if the user inputs a lower case letter, changes it
#to uppercase to match the code.
rentalCode = input("(B)udget, (D)aily, or (W)eekly rental?\n").upper()
#this block of code provides a loop wherein if the user inputs anything besides B, D, or ... | 45.91954 | 128 | 0.722904 | import sys
#this code asks the user to input the rental code B, D, or W. as well as if the user inputs a lower case letter, changes it
#to uppercase to match the code.
rentalCode = input("(B)udget, (D)aily, or (W)eekly rental?\n").upper()
#this block of code provides a loop wherein if the user inputs anything beside... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -11 | 22 |
f6b926004f1740bebae35f7fc98b1abf6a61ed14 | 2,111 | py | Python | battingOrbowling_comp.py | ThomasAitken/Cricket-Modelling-Project | a0b8265c562d988dab16a145dc2e73225e2a4774 | [
"MIT"
] | null | null | null | battingOrbowling_comp.py | ThomasAitken/Cricket-Modelling-Project | a0b8265c562d988dab16a145dc2e73225e2a4774 | [
"MIT"
] | null | null | null | battingOrbowling_comp.py | ThomasAitken/Cricket-Modelling-Project | a0b8265c562d988dab16a145dc2e73225e2a4774 | [
"MIT"
] | null | null | null | #how to get a measure of batting or bowling strength? why it's simple! take top-100 rankings list at given period...
#what is score held by #1 player? normalise against this score (i.e. this score now equivalent to 1)
#now add up top 8 normalised scores for each nation's top 8 players in top 100 (set x: 0 <= x <= 1) .... | 39.830189 | 226 | 0.672667 | #how to get a measure of batting or bowling strength? why it's simple! take top-100 rankings list at given period...
#what is score held by #1 player? normalise against this score (i.e. this score now equivalent to 1)
#now add up top 8 normalised scores for each nation's top 8 players in top 100 (set x: 0 <= x <= 1) .... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
868a5177cfe7a43dcc855371fdd275a394644658 | 2,074 | py | Python | homeassistant/components/eight_sleep/binary_sensor.py | liangleslie/core | cc807b4d597daaaadc92df4a93c6e30da4f570c6 | [
"Apache-2.0"
] | 2 | 2020-01-03T17:06:33.000Z | 2020-01-13T18:57:32.000Z | homeassistant/components/eight_sleep/binary_sensor.py | liangleslie/core | cc807b4d597daaaadc92df4a93c6e30da4f570c6 | [
"Apache-2.0"
] | 1,016 | 2019-06-18T21:27:47.000Z | 2020-03-06T11:09:58.000Z | homeassistant/components/eight_sleep/binary_sensor.py | liangleslie/core | cc807b4d597daaaadc92df4a93c6e30da4f570c6 | [
"Apache-2.0"
] | null | null | null | """Support for Eight Sleep binary sensors."""
from __future__ import annotations
import logging
_LOGGER = logging.getLogger(__name__)
| 28.805556 | 81 | 0.700579 | """Support for Eight Sleep binary sensors."""
from __future__ import annotations
import logging
from pyeight.eight import EightSleep
from homeassistant.components.binary_sensor import (
BinarySensorDeviceClass,
BinarySensorEntity,
)
from homeassistant.core import HomeAssistant
from homeassistant.helpers.enti... | 0 | 150 | 598 | 651 | 0 | 0 | 0 | 312 | 225 |
b5d6b3c2d30eead81f511bc81f8bfb38ee374864 | 17,462 | py | Python | examples/fabric/build_configs.py | RafaelAPB/umbra | cf075bbe73e46540e9edee25f9ec3d0828620d5f | [
"Apache-2.0"
] | null | null | null | examples/fabric/build_configs.py | RafaelAPB/umbra | cf075bbe73e46540e9edee25f9ec3d0828620d5f | [
"Apache-2.0"
] | null | null | null | examples/fabric/build_configs.py | RafaelAPB/umbra | cf075bbe73e46540e9edee25f9ec3d0828620d5f | [
"Apache-2.0"
] | null | null | null | import logging
def setup_logging(log_level=logging.DEBUG):
"""Set up the logging."""
logging.basicConfig(level=log_level)
fmt = ("%(asctime)s %(levelname)s (%(threadName)s) "
"[%(name)s] %(message)s")
colorfmt = "%(log_color)s{}%(reset)s".format(fmt)
datefmt = '%Y-%m-%d %H:%M:%S'
t... | 31.463063 | 119 | 0.498282 | import os
import sys
import logging
from umbra.design.configs import Profile, Topology, Scenario
from umbra.design.configs import FabricTopology
from base_configtx.fabric import org1_policy, org2_policy, org3_policy, org4_policy, orderer_policy, configtx
def build_simple_fabric_cfg():
temp_dir = "./fabric_conf... | 0 | 0 | 0 | 0 | 0 | 16,272 | 0 | 130 | 158 |
503fa3ffc50e8ab4d22e532d8256fe09c7188840 | 3,123 | py | Python | backend/services/word_service.py | EuleMitKeule/streetview-bingo | 17308e44bd6b573bbac6b852fff4b1f9bc1081f3 | [
"Unlicense"
] | 1 | 2021-03-19T22:17:01.000Z | 2021-03-19T22:17:01.000Z | backend/services/word_service.py | EuleMitKeule/streetview-bingo | 17308e44bd6b573bbac6b852fff4b1f9bc1081f3 | [
"Unlicense"
] | 10 | 2021-03-07T17:53:36.000Z | 2021-04-15T07:52:05.000Z | backend/services/word_service.py | euleGIT/streetview-bingo | 17308e44bd6b573bbac6b852fff4b1f9bc1081f3 | [
"Unlicense"
] | null | null | null | import re
from typing import List
from flask import current_app
from models.word import Word
from sqlalchemy.sql.expression import func
db = current_app.db
def get_word(word_id: int = None, text: str = None):
"""
Returns a word from the word database.
:param text: The text of the word to return
:pa... | 24.209302 | 86 | 0.618636 | import re
from typing import List
from flask import current_app
from models.word import Word
from sqlalchemy.sql.expression import func
db = current_app.db
def get_word(word_id: int = None, text: str = None):
"""
Returns a word from the word database.
:param text: The text of the word to return
:pa... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5d8c92b5946514cca430a84ae21f6aa07d586033 | 1,636 | py | Python | django_blog/user/views.py | Song2017/web-python | 4eef069c6e3d7c9a0ca7cd69381579f1cb428c69 | [
"MIT"
] | null | null | null | django_blog/user/views.py | Song2017/web-python | 4eef069c6e3d7c9a0ca7cd69381579f1cb428c69 | [
"MIT"
] | null | null | null | django_blog/user/views.py | Song2017/web-python | 4eef069c6e3d7c9a0ca7cd69381579f1cb428c69 | [
"MIT"
] | null | null | null |
# Create your views here.
| 30.867925 | 78 | 0.625306 | from django.shortcuts import render
from django.http import JsonResponse, HttpRequest, HttpResponse
from django.http import HttpResponseBadRequest
import json
import logging
from .models import User
from django.db.models.query import *
def checkemail(request):
return HttpResponse()
# Create your views here.
de... | 21 | 0 | 0 | 0 | 0 | 1,318 | 0 | 82 | 200 |
8cc13c38198e2da327e7e852a6a475c859e5c625 | 4,739 | py | Python | agsadmin/sharing_admin/community/groups/CreateUpdateGroupParams.py | christopherblanchfield/agsadmin | 989cb3795aacf285ccf74ee51b0de26bf2f48bc3 | [
"BSD-3-Clause"
] | 2 | 2015-12-07T05:53:29.000Z | 2020-09-13T18:12:15.000Z | agsadmin/sharing_admin/community/groups/CreateUpdateGroupParams.py | christopherblanchfield/agsadmin | 989cb3795aacf285ccf74ee51b0de26bf2f48bc3 | [
"BSD-3-Clause"
] | 4 | 2015-03-09T05:59:14.000Z | 2018-01-09T00:12:56.000Z | agsadmin/sharing_admin/community/groups/CreateUpdateGroupParams.py | christopherblanchfield/agsadmin | 989cb3795aacf285ccf74ee51b0de26bf2f48bc3 | [
"BSD-3-Clause"
] | 5 | 2015-03-09T01:05:24.000Z | 2019-09-09T23:01:21.000Z | from __future__ import (absolute_import, division, print_function, unicode_literals)
| 27.393064 | 122 | 0.624604 | from __future__ import (absolute_import, division, print_function, unicode_literals)
from builtins import (ascii, bytes, chr, dict, filter, hex, input, int, map, next, oct, open, pow, range, round, str,
super, zip)
import copy
from enum import Enum
class GroupAccess(Enum):
PRIVATE = "priva... | 0 | 3,267 | 0 | 1,103 | 0 | 0 | 0 | 120 | 160 |
b95275beb78a3455a343c494fd055ddb75390e80 | 3,246 | py | Python | stanza/utils/datasets/ner/convert_fire_2013.py | asears/stanza | f91ca215e175d4f7b202259fe789374db7829395 | [
"Apache-2.0"
] | 3,633 | 2016-01-21T17:29:13.000Z | 2022-03-31T13:36:47.000Z | stanza/utils/datasets/ner/convert_fire_2013.py | asears/stanza | f91ca215e175d4f7b202259fe789374db7829395 | [
"Apache-2.0"
] | 593 | 2016-01-19T07:16:05.000Z | 2022-03-31T20:23:58.000Z | stanza/utils/datasets/ner/convert_fire_2013.py | asears/stanza | f91ca215e175d4f7b202259fe789374db7829395 | [
"Apache-2.0"
] | 525 | 2016-01-20T03:22:19.000Z | 2022-03-24T05:51:56.000Z | """
Converts the FIRE 2013 dataset to TSV
http://au-kbc.org/nlp/NER-FIRE2013/index.html
The dataset is in six tab separated columns. The columns are
word tag chunk ner1 ner2 ner3
This script keeps just the word and the ner1. It is quite possible that using the tag would help
"""
import argparse
import random
... | 38.642857 | 150 | 0.63586 | """
Converts the FIRE 2013 dataset to TSV
http://au-kbc.org/nlp/NER-FIRE2013/index.html
The dataset is in six tab separated columns. The columns are
word tag chunk ner1 ner2 ner3
This script keeps just the word and the ner1. It is quite possible that using the tag would help
"""
import argparse
import glob
impor... | 0 | 0 | 0 | 0 | 0 | 2,039 | 0 | -22 | 113 |
258e8b7408d8f45439cb78dfc2ea1e6075f3fa15 | 5,941 | py | Python | traniest/bootstrap/df.py | Sekie/TranIEST | 1855a6002aa6dc806a5765ddf7be0ca1112c3733 | [
"MIT"
] | null | null | null | traniest/bootstrap/df.py | Sekie/TranIEST | 1855a6002aa6dc806a5765ddf7be0ca1112c3733 | [
"MIT"
] | 1 | 2021-09-17T18:19:23.000Z | 2021-09-17T18:19:23.000Z | traniest/bootstrap/df.py | the-hktran/TranIEST | 1855a6002aa6dc806a5765ddf7be0ca1112c3733 | [
"MIT"
] | null | null | null | import numpy as np
from pyscf import gto, scf, ao2mo
if __name__ == "__main__":
#def main():
from pyscf import ao2mo
import time
mol = gto.Mole()
mol.fromfile("/work/henry/Calculations/BE/C16_ex/geom/C16_ether.xyz")
mol.basis = 'cc-pvdz'
mol.build()
N = mol.nbas
nOcc = mol.nelec[0]
nVir = N - nOcc
mf = s... | 26.641256 | 202 | 0.630702 | import numpy as np
from pyscf import gto, scf, ao2mo
from traniest.bootstrap import mp2_emb
def CustomMF(h, V, n, ENuc = 0.0, S = None):
if S is None:
S = np.eye(h.shape[0])
mol = gto.M()
mol.nelectron = n
def energy_nuc():
return ENuc
mol.energy_nuc = energy_nuc
mf = scf.RHF(mol)
mf.get_hcore = lambda *ar... | 0 | 0 | 0 | 0 | 0 | 3,142 | 0 | 71 | 367 |
43275cba628b58d62aa068da69dfbad380d36cb7 | 7,924 | py | Python | anchore_engine/db/db_policyeval.py | dspalmer99/anchore-engine | 8c61318be6fec5d767426fa4ccd98472cc85b5cd | [
"Apache-2.0"
] | 1 | 2020-06-22T07:27:41.000Z | 2020-06-22T07:27:41.000Z | anchore_engine/db/db_policyeval.py | dspalmer99/anchore-engine | 8c61318be6fec5d767426fa4ccd98472cc85b5cd | [
"Apache-2.0"
] | 4 | 2020-11-07T00:16:02.000Z | 2020-11-08T20:52:06.000Z | anchore_engine/db/db_policyeval.py | dspalmer99/anchore-engine | 8c61318be6fec5d767426fa4ccd98472cc85b5cd | [
"Apache-2.0"
] | null | null | null | from anchore_engine.db import PolicyEval
# specific DB interface helpers for the 'policyeval' table
def add_all_for_digest(userId, records, session):
"""
Assumes these are all valid records.
:param records: list of dicts from PolicyEval json dumps
:param session:
:return:
"""
recs = []
... | 29.239852 | 193 | 0.660399 | import time
from sqlalchemy import desc
from anchore_engine import db
from anchore_engine.db import PolicyEval
# specific DB interface helpers for the 'policyeval' table
def tsadd(policyId, userId, imageDigest, tag, final_action, inobj, session=None):
if not session:
session = db.Session
latest_res... | 0 | 0 | 0 | 0 | 0 | 7,054 | 0 | 4 | 390 |
293406aa0b1ac51d2338253d0bb97cf517425a1e | 733 | py | Python | easy/1304-Find N Unique Integers Sum up to Zero.py | Davidxswang/leetcode | d554b7f5228f14c646f726ddb91014a612673e06 | [
"Apache-2.0"
] | 2 | 2020-05-08T02:17:17.000Z | 2020-05-17T04:55:56.000Z | easy/1304-Find N Unique Integers Sum up to Zero.py | Davidxswang/leetcode | d554b7f5228f14c646f726ddb91014a612673e06 | [
"Apache-2.0"
] | null | null | null | easy/1304-Find N Unique Integers Sum up to Zero.py | Davidxswang/leetcode | d554b7f5228f14c646f726ddb91014a612673e06 | [
"Apache-2.0"
] | null | null | null | """
https://leetcode.com/problems/find-n-unique-integers-sum-up-to-zero/
Given an integer n, return any array containing n unique integers such that they add up to 0.
Example 1:
Input: n = 5
Output: [-7,-1,1,3,4]
Explanation: These arrays also are accepted [-5,-1,1,2,3] , [-3,-1,2,-2,4].
Example 2:
Input: n = 3
O... | 18.794872 | 93 | 0.537517 | """
https://leetcode.com/problems/find-n-unique-integers-sum-up-to-zero/
Given an integer n, return any array containing n unique integers such that they add up to 0.
Example 1:
Input: n = 5
Output: [-7,-1,1,3,4]
Explanation: These arrays also are accepted [-5,-1,1,2,3] , [-3,-1,2,-2,4].
Example 2:
Input: n = 3
O... | 0 | 0 | 0 | 254 | 0 | 0 | 0 | 0 | 22 |
af5ebbb7cd2fa282ee62f5c37d47e85b9233ba3b | 575 | py | Python | pydash/Dash/Measurement/Metric/centimeter.py | ensomniac/dash | 5a5cabd1a1d057015dd1446b6b1000af1e521355 | [
"MIT"
] | null | null | null | pydash/Dash/Measurement/Metric/centimeter.py | ensomniac/dash | 5a5cabd1a1d057015dd1446b6b1000af1e521355 | [
"MIT"
] | null | null | null | pydash/Dash/Measurement/Metric/centimeter.py | ensomniac/dash | 5a5cabd1a1d057015dd1446b6b1000af1e521355 | [
"MIT"
] | null | null | null | #!/usr/bin/python
#
# 2022 Ryan Martin, ryan@ensomniac.com
# Andrew Stet, stetandrew@gmail.com
Centimeter = _Centimeter()
| 15.540541 | 40 | 0.627826 | #!/usr/bin/python
#
# 2022 Ryan Martin, ryan@ensomniac.com
# Andrew Stet, stetandrew@gmail.com
import os
import sys
class _Centimeter:
def __init__(self):
pass
@property
def DisplayName(self):
return "Centimeter"
@property
def AssetPath(self):
return "centimeter"
... | 0 | 168 | 0 | 232 | 0 | 0 | 0 | -23 | 68 |
6aec569dc87bdadfbabe51bf3c1de32722338bfb | 3,014 | py | Python | openmc/data/grid.py | janmalec/openmc | 4a4ac4c351d41fe153ca3341820cc507e484ce50 | [
"MIT"
] | 1 | 2021-07-05T00:08:39.000Z | 2021-07-05T00:08:39.000Z | openmc/data/grid.py | janmalec/openmc | 4a4ac4c351d41fe153ca3341820cc507e484ce50 | [
"MIT"
] | 2 | 2020-02-24T15:13:15.000Z | 2020-03-17T18:59:22.000Z | openmc/data/grid.py | janmalec/openmc | 4a4ac4c351d41fe153ca3341820cc507e484ce50 | [
"MIT"
] | null | null | null | import numpy as np
def linearize(x, f, tolerance=0.001):
"""Return a tabulated representation of a one-variable function
Parameters
----------
x : Iterable of float
Initial x values at which the function should be evaluated
f : Callable
Function of a single variable
tolerance ... | 26.208696 | 80 | 0.535169 | import numpy as np
def linearize(x, f, tolerance=0.001):
"""Return a tabulated representation of a one-variable function
Parameters
----------
x : Iterable of float
Initial x values at which the function should be evaluated
f : Callable
Function of a single variable
tolerance ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f4490d9c38a684b9846df0da771aa8439ff444f5 | 442 | py | Python | datahub_core/generators/attribute_generators/choice_generator.py | grovesy/datahub | 57bd1a837b9996c2dae5e052a94131b8fc56e3fb | [
"Apache-2.0"
] | 67 | 2020-05-15T09:37:20.000Z | 2022-03-18T04:12:08.000Z | datahub_core/generators/attribute_generators/choice_generator.py | grovesy/datahub | 57bd1a837b9996c2dae5e052a94131b8fc56e3fb | [
"Apache-2.0"
] | 37 | 2020-05-15T08:03:17.000Z | 2020-10-28T12:24:30.000Z | datahub_core/generators/attribute_generators/choice_generator.py | grovesy/datahub | 57bd1a837b9996c2dae5e052a94131b8fc56e3fb | [
"Apache-2.0"
] | 10 | 2020-05-16T14:11:12.000Z | 2021-10-06T19:20:47.000Z | from ... import metrics as fr_metrics
| 27.625 | 70 | 0.653846 | from ... import metrics as fr_metrics
class ChoiceGenerator():
@fr_metrics.timeit
def __init__(self, random_state, data, weights=None):
self.random_state = random_state
self.data = data
self.weights = weights
@fr_metrics.timeit
def make(self):
if self.weights:
... | 0 | 325 | 0 | 3 | 0 | 0 | 0 | 0 | 76 |
71487e312077008c6237dd72f16a1415033b61c3 | 10,855 | py | Python | pycollisionavoidance/collision/Avoidance.py | virtual-origami/pycollisionavoidance | a58f496efed2d945e361305b27f7bbe3c360dff7 | [
"MIT"
] | null | null | null | pycollisionavoidance/collision/Avoidance.py | virtual-origami/pycollisionavoidance | a58f496efed2d945e361305b27f7bbe3c360dff7 | [
"MIT"
] | 1 | 2021-12-10T22:16:01.000Z | 2021-12-11T11:30:35.000Z | pycollisionavoidance/collision/Avoidance.py | virtual-origami/pycollisionavoidance | a58f496efed2d945e361305b27f7bbe3c360dff7 | [
"MIT"
] | null | null | null | # Python code for 2D random walk.
import logging
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
handler = logging.FileHandler('/tmp/walkgen.log')
handler.setLevel(logging.ERROR)
formatter = logging.Formatter('%(levelname)-8s-[%(filename)s:%(lineno)d]-%(message)s')
handler.setFormatter(formatter)
l... | 46.587983 | 118 | 0.516352 | # Python code for 2D random walk.
import json
import sys
import random
import time
import math
import logging
import asyncio
from pycollisionavoidance.pub_sub.AMQP import PubSubAMQP
from pycollisionavoidance.raycast.Particle import Particle
from pycollisionavoidance.raycast.StaticMap import StaticMap
from pycollisionav... | 0 | 0 | 2,287 | 7,745 | 0 | 0 | 0 | 113 | 243 |
485a8aa71de57d9eab38fd12c97df888a2dbbaf2 | 1,331 | py | Python | setup.py | Coder-Iro/webptools | b540f6281260f6123c1ed54988ceed75c64f2841 | [
"MIT"
] | null | null | null | setup.py | Coder-Iro/webptools | b540f6281260f6123c1ed54988ceed75c64f2841 | [
"MIT"
] | null | null | null | setup.py | Coder-Iro/webptools | b540f6281260f6123c1ed54988ceed75c64f2841 | [
"MIT"
] | null | null | null | import setuptools
with open('README.md') as f:
long_description = f.read()
setuptools.setup(
name="webptools",
version="0.0.3",
scripts=['webptools/webplib.py'],
author="Sai Kumar Yava",
author_email="saikumar.geek@gmail.com",
description="webptools is a Webp image conversion package for p... | 35.026316 | 95 | 0.638618 | import setuptools
with open('README.md') as f:
long_description = f.read()
setuptools.setup(
name="webptools",
version="0.0.3",
scripts=['webptools/webplib.py'],
author="Sai Kumar Yava",
author_email="saikumar.geek@gmail.com",
description="webptools is a Webp image conversion package for p... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c3f85c9564d0e4db1cc0f0fe690a541f6ea981f0 | 4,083 | py | Python | scripts/find_campaign_donor_overlap.py | Financial-Times/fec-donor-overlaps | 0e787eede00880cbed0c3812a4ae689a9ff53399 | [
"MIT"
] | 6 | 2022-02-14T21:54:03.000Z | 2022-02-19T15:03:40.000Z | scripts/find_campaign_donor_overlap.py | Financial-Times/fec-donor-overlaps | 0e787eede00880cbed0c3812a4ae689a9ff53399 | [
"MIT"
] | null | null | null | scripts/find_campaign_donor_overlap.py | Financial-Times/fec-donor-overlaps | 0e787eede00880cbed0c3812a4ae689a9ff53399 | [
"MIT"
] | 1 | 2022-02-15T13:26:15.000Z | 2022-02-15T13:26:15.000Z |
committee_for_analysis = "actblue"
DATAFILE_SOURCE = f"../data/processed_data/contributions/{committee_for_analysis}_candidate_donor_mappings.csv"
DONOR_LIST_SOURCE = f"../data/processed_data/overlap/{committee_for_analysis}_donor_lists.json"
OVERLAP_OUTFILE_DESTINATION = f"../data/processed_data/overlap/{committee_... | 37.458716 | 136 | 0.680382 | import os
import time
import json
import csv
import pandas as pd
committee_for_analysis = "actblue"
DATAFILE_SOURCE = f"../data/processed_data/contributions/{committee_for_analysis}_candidate_donor_mappings.csv"
DONOR_LIST_SOURCE = f"../data/processed_data/overlap/{committee_for_analysis}_donor_lists.json"
OVERLAP_O... | 0 | 0 | 0 | 0 | 0 | 3,424 | 0 | -45 | 202 |
7a2a95d1aa31b961ee1a9e0bbe5dcbcc7130d4c5 | 13,159 | py | Python | measure_segmentation.py | aditya-khant/sheet-id-splitter | d8bbdfe2158c95a16ca14293eba989d32d520c32 | [
"MIT"
] | null | null | null | measure_segmentation.py | aditya-khant/sheet-id-splitter | d8bbdfe2158c95a16ca14293eba989d32d520c32 | [
"MIT"
] | null | null | null | measure_segmentation.py | aditya-khant/sheet-id-splitter | d8bbdfe2158c95a16ca14293eba989d32d520c32 | [
"MIT"
] | null | null | null | # Measure segmentation of sheet music
# Imports
import os.path as path
import cv2 as cv
import numpy as np
from scipy.signal import find_peaks
import warnings
# Score-retrieval inputs
from benchmarks import call_benchmark
try:
except:
warnings.warn("Warning: Install the score-retrieval repository")
############... | 36.654596 | 115 | 0.617752 | # Measure segmentation of sheet music
# Imports
import os.path as path
import sys
import cv2 as cv
import matplotlib.pyplot as plt
import numpy as np
from scipy.signal import argrelextrema
from scipy.signal import find_peaks
import warnings
# Score-retrieval inputs
from benchmarks import call_benchmark
try:
impor... | 0 | 0 | 0 | 0 | 1,232 | 0 | 0 | 22 | 161 |
23c511de8207f7bab1dbb91a4a68746b7b23c4a7 | 3,719 | py | Python | blues/solr.py | flaeppe/blues | 6e4eede6efb3a6077feea5f65b96b492062cf4d7 | [
"MIT"
] | 3 | 2015-10-10T23:42:05.000Z | 2017-08-18T01:01:58.000Z | blues/solr.py | flaeppe/blues | 6e4eede6efb3a6077feea5f65b96b492062cf4d7 | [
"MIT"
] | 46 | 2015-02-13T15:18:12.000Z | 2021-11-11T10:17:33.000Z | blues/solr.py | flaeppe/blues | 6e4eede6efb3a6077feea5f65b96b492062cf4d7 | [
"MIT"
] | 14 | 2015-01-26T22:19:21.000Z | 2019-09-06T07:56:37.000Z | """
Solr Blueprint
==============
**Fabric environment:**
.. code-block:: yaml
blueprints:
- blues.solr
settings:
solr:
version: 4.10.2 # Solr version to install (Required)
# memory: 1024m # Specify minimum and maximum heap size in mb (Default: 512m)
"""
from refabric.contrib ... | 27.145985 | 90 | 0.596128 | """
Solr Blueprint
==============
**Fabric environment:**
.. code-block:: yaml
blueprints:
- blues.solr
settings:
solr:
version: 4.10.2 # Solr version to install (Required)
# memory: 1024m # Specify minimum and maximum heap size in mb (Default: 512m)
"""
import os
from fabric... | 0 | 909 | 0 | 0 | 0 | 1,537 | 0 | 101 | 295 |
50bcd95b2b95178268173ffa9e972e2374840030 | 767 | py | Python | train/views.py | amateur-dev/django_trainbooking_tutorial | 3160827a6817c772e7fe2c34c981c017942fcc4f | [
"BSD-3-Clause"
] | null | null | null | train/views.py | amateur-dev/django_trainbooking_tutorial | 3160827a6817c772e7fe2c34c981c017942fcc4f | [
"BSD-3-Clause"
] | null | null | null | train/views.py | amateur-dev/django_trainbooking_tutorial | 3160827a6817c772e7fe2c34c981c017942fcc4f | [
"BSD-3-Clause"
] | null | null | null |
# Create your views here.
| 24.741935 | 71 | 0.672751 | from django.http import HttpResponse, Http404
from django.shortcuts import render
from .models import Train
from .models import Station
from .models import Passenger
# Create your views here.
def index(request):
context = {
"trains": Train.objects.all(),
"stations": Station.objects.all()
}
... | 0 | 0 | 0 | 0 | 0 | 525 | 0 | 56 | 157 |
36395a60ee0e0d94e5fc695df84eaf9b04159497 | 2,599 | py | Python | majavahbot/web/blueprint.py | wikimedia/labs-tools-majavah-bot | 2720956316c6938dad161564dd44693e05719db4 | [
"MIT"
] | null | null | null | majavahbot/web/blueprint.py | wikimedia/labs-tools-majavah-bot | 2720956316c6938dad161564dd44693e05719db4 | [
"MIT"
] | null | null | null | majavahbot/web/blueprint.py | wikimedia/labs-tools-majavah-bot | 2720956316c6938dad161564dd44693e05719db4 | [
"MIT"
] | null | null | null | from flask import Blueprint
blueprint = Blueprint('majavah-bot', __name__)
# utils to be used in tempale
| 27.357895 | 147 | 0.669104 | from flask import Blueprint, render_template
from majavahbot.api.consts import *
from majavahbot.api.database import task_database
from majavahbot.api.utils import get_revision
from majavahbot.tasks import task_registry
blueprint = Blueprint('majavah-bot', __name__)
def map_task(db_row):
registry_task = task_re... | 0 | 1,382 | 0 | 0 | 0 | 774 | 0 | 104 | 226 |