blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 2 283 | content_id stringlengths 40 40 | detected_licenses listlengths 0 91 | license_type stringclasses 2
values | repo_name stringlengths 3 135 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 68 | visit_date timestamp[ns]date 2015-07-25 20:53:29 2023-09-06 10:46:05 | revision_date timestamp[ns]date 1970-01-01 00:00:00 2037-05-03 13:00:00 | committer_date timestamp[ns]date 1970-01-01 00:00:00 2036-02-09 17:40:36 | github_id int64 1.61k 691M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 24
values | gha_event_created_at timestamp[ns]date 2012-06-03 10:21:33 2023-09-14 21:59:50 ⌀ | gha_created_at timestamp[ns]date 2008-03-27 23:40:48 2023-09-13 22:40:33 ⌀ | gha_language stringclasses 250
values | src_encoding stringclasses 27
values | language stringclasses 1
value | is_vendor bool 2
classes | is_generated bool 2
classes | length_bytes int64 6 10M | extension stringclasses 289
values | filename stringlengths 1 218 | content stringlengths 6 10M |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1ac94c17932c84d5a2ebeba875bc4155d58faa97 | c8b24547d95425921353c36f43468ebe0d2a7736 | /py2048.py | dd2753c3ec16695478e72e91773920834cf05cb3 | [] | no_license | leeyy216/pyall1 | 63e508a5ab6475a43ae1b9a026bde0c436a83a64 | 7f4d721227ee35c7aaa0ca13c1fea74e63ce2aa4 | refs/heads/master | 2020-04-08T21:49:33.098839 | 2018-11-30T05:42:41 | 2018-11-30T05:42:41 | 159,760,065 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 1,106 | py | py2048.py | import curses
from random import randrange, choice
from collections import defaultdict
actions = ['Up', 'Left', 'Down', 'Right', 'Restart', 'Exit']
letter_codes = [ord(ch) for ch in 'WASDRQwasdrq']
actions_dict = dict(zip(letter_codes, actions * 2))
state_actions = {
'Init': init,
'Win': lambda: not_g... |
ca292265a551cea517dc676a205b899842d07680 | fed270f091027f1d560d36f408b4373e843f0356 | /numpyDemo.py | fb957464c909f3e4b5e5e6e17479ecc0ea7ef351 | [] | no_license | HSUANTSA/test_demo | d73a6a02593ccf79d7b5ebc5f08143f7fc22fae5 | 59d8f65355a719cd289f1ac627dec04732fdff16 | refs/heads/master | 2020-05-20T02:28:01.051653 | 2019-05-07T16:38:35 | 2019-05-07T16:38:35 | 185,333,118 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,026 | py | numpyDemo.py | #11. Numpy array takes less memory compare to python list
# import numpy as np
# import sys
#
# lst = range(1000)
# arr1 = np.arange(1000)
#
# print("The list occupied space is",sys.getsizeof(1) * len(lst),"bytes")
# print("The array occupied space is",arr1.itemsize * arr1.size,"bytes")
#2. Numpy arrays runs very fas... |
96e621519c9670bd8319a1c2a92a0f8dd630b1fa | 8710e229f3735d2f6e222dd801cd446a1cc55f5e | /addlist2.py | 82e33107b1b68b52faeac9a38d8cdc502a9a9102 | [] | no_license | OwenClevers/sample | cb827cfa88cc40595018dcc54586911734a6f0f9 | 2f370cad0e2181b711d39a245429bacb421b5b36 | refs/heads/master | 2022-11-28T22:55:31.828303 | 2020-08-17T12:37:53 | 2020-08-17T12:37:53 | 288,162,295 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 631 | py | addlist2.py | def sum_positive(n):
sum = 0
for item in n:
item = item if item > 0 else item * -1
sum += item
return sum
def count_evens(n):
count = 0
for item in n:
if item % 2 == 0:
count += item
elif item % 2 != 0:
count += 0
elif n == []:
... |
c43ed7a44b7758c7b075c265ce89f97440cca3aa | 20a4aab32750dbc7952197b2bc2da04033d0f4c8 | /operating_on_vectors.py | 4c03ff8b5f1c8dccc26cca9c8c6f8580f3173061 | [] | no_license | Joy110900/Linear-Algebra | e9d4ef6ba278832132b34751d57c7272f3f6d468 | a6a71ae5fb3c31d0b42f4855c181f74c92eb3957 | refs/heads/master | 2020-08-21T08:00:57.588605 | 2019-11-10T16:49:47 | 2019-11-10T16:49:47 | 216,115,436 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,030 | py | operating_on_vectors.py | import math
pi = math.pi
e = math.e
class vector(object):
def __init__(self, coordinates):
"""This func is like constructor in c++. Here it initialises our vector with values from user."""
try:
if not coordinates:
raise ValueError
self.coordinates = tuple(co... |
02a53d72d795b51335a2d04c19c3a75cb49fa98f | aefab6e19fee125ff32c7c4e25a94b4539f2eff9 | /v3flash_trial.py | 1309f2e5303f5391d052af9f23388259feaa97cb | [] | no_license | cat-boucher/psychopy_multisensory | 11b260aaf84855cc1d9546e363db53c7b05c10fd | 1627950b05dc025d0d463d0aac9bd74fedd08bae | refs/heads/master | 2022-12-02T21:02:51.899064 | 2020-08-13T21:16:27 | 2020-08-13T21:16:27 | 268,152,888 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,132 | py | v3flash_trial.py | from psychopy import data, visual, core, monitors
import itertools
import flash_stim as fs
import v2_flash_stim as fs2
import random # will use to randomize/shuffle
import numpy as np
import tdt
# TODO: hard-coded in values for now...refactor as class to take lists as params.
#universal parameters
numTrials = 5
ISI ... |
b72331cd0b8f9a1cb4c39540bf5b40e1bcd190d4 | 9d90b664ebbd11a57ee6156c528081551b98055b | /wsgi/local_data/brython_programs/enumerate1.py | 37cea89727173bbcae645b175ef100ad474b88f2 | [] | no_license | 2014cdag21/c21 | d4f85f91ba446feb6669a39903dda38c21e8b868 | faf4b354f7d1d4abec79c683d7d02055c6bab489 | refs/heads/master | 2020-06-03T17:54:16.144118 | 2014-06-20T09:29:02 | 2014-06-20T09:29:02 | 19,724,479 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 81 | py | enumerate1.py | a = ['a', 'b', 'c', 'd', 'e']
for index, item in enumerate(a): print(index, item) |
73ebf55de641c720556dde04843dd380e995e7fd | 3c2ee998c99a693b3b04d44f8c5af0fc5fb2c49d | /tests/backend/integration/api/projects/test_statistics.py | 5dc06a8e1fbc4f5ca345bac6f3e02e3e8b394116 | [
"BSD-2-Clause"
] | permissive | hotosm/tasking-manager | 4520a56b31b35ebfc82a337bc7e676f1f8bc946a | 45bf3937c74902226096aee5b49e7abea62df524 | refs/heads/develop | 2023-09-01T02:43:43.875659 | 2023-08-16T21:26:02 | 2023-08-29T13:15:52 | 80,733,077 | 526 | 316 | BSD-2-Clause | 2023-09-14T10:15:55 | 2017-02-02T14:31:35 | JavaScript | UTF-8 | Python | false | false | 4,012 | py | test_statistics.py | import time
from tests.backend.base import BaseTestCase
from tests.backend.helpers.test_helpers import (
create_canned_project,
generate_encoded_token,
)
from backend.services.project_admin_service import ProjectAdminService
from backend.models.postgis.task import Task, TaskStatus
class TestProjectStatistics... |
f89301ad9d8fc64f929668ef7a686d7421b6329c | 20d8506cfdc1bf40edf934b3868c0a94a0b81ab9 | /simulation.py | a87f2b8fcde75f7f72ee5ee3005ac95efb9598e1 | [] | no_license | vtoroer/Moon-travel | cd1f4f893c409bda03c024d163bdd1dc65db4422 | 9db98c26ec910155ac9e87ebef3c2ee0bbe95e76 | refs/heads/master | 2023-01-31T00:57:12.380099 | 2020-12-03T14:25:47 | 2020-12-03T14:25:47 | 296,650,356 | 0 | 0 | null | 2020-11-29T10:57:52 | 2020-09-18T14:50:57 | Python | UTF-8 | Python | false | false | 10,213 | py | simulation.py | from plotting import *
from vehicles import *
from vector import *
from active_part import *
import arcade
THRUST_ENABLED = False
SCREEN_WIDTH = 1480
SCREEN_HEIGHT = 800
FACTOR = 5 * 10**(-6)
class MyGame(arcade.Window):
""" Main application class. """
def __init__(self, width, height):
... |
fc226b5c21fd88bd15724460251b57b32a772163 | b7b22fe55a24e202e3c1ac28f70d3c131323e669 | /projects-source/django/month_challenges/challenges/views.py | adbe14be526231b90b3f632226cbc245bdfba23f | [] | no_license | EdgarLozano185519/100-Days-of-Python | 637e0dd99868fc1fb59f8fd5f9449273697f3f70 | 7ed72b364cc5143e517f00cb08924745c3412fdd | refs/heads/master | 2023-06-05T13:20:21.769185 | 2021-06-28T00:55:43 | 2021-06-28T00:55:43 | 331,151,112 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 1,270 | py | views.py | from django.shortcuts import render
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseNotFound
from django.urls import reverse
monthly_challenges = {
"january": "Learn how to code",
"february": "learn about Python.",
"march": "Learn about C#",
"april": "Learn about Java",
"may... |
c505c0a9f1dfd8b6f25ea482315a4560554924cd | 8c4981c0736546948a2bb066a107ddf183ec81bc | /client_udp.py | 9b02cfb81b159b154f42eba3c3acd736c3a6389e | [] | no_license | mdukehall/Python-Scripts | b4ef3618012f2034d775b3a7e9c5831a83e2a99a | 97058adb881d13c8ec858acb4fe06db3f9fe06f6 | refs/heads/master | 2021-05-15T01:33:46.345565 | 2016-11-07T19:52:17 | 2016-11-07T19:52:17 | 41,311,136 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 716 | py | client_udp.py | import socket
target_host="127.0.0.1" #string DNS or IP
target_port=80 #integer
#create UDP socket
#doc: https://docs.python.org/2/library/socket.html
#AF_INET is for Address Family; ipv4; AF_INET6 would be ipv6, etc
#SOCK_STREAM is default value, SOCK_DGRAM is for a data gram
client = socket... |
351952d0848426d91d68aff9b257edc203ed0ab8 | 2d40c3954ff832049ad3462ee6dd074015df9476 | /django_project1/first_app/views.py | 71b266878c87dc593e77213ffa4c720823371b87 | [] | no_license | gr8springboard/django-development | 360a283260bef2d7c7e816d4c773cd4b302dc30b | d4f39109e1c87e3637b9240152972dd745cd0a32 | refs/heads/master | 2020-03-15T09:19:46.893280 | 2018-05-04T02:54:53 | 2018-05-04T02:54:53 | 132,071,926 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 695 | py | views.py | from django.shortcuts import render
# Create your views here.
from django.http import HttpResponse
# For MTV testing, we need to import models
from first_app.models import Topic, Webpage, AccessRecodrd
def index(request):
#webpage_list = Webpage.objects.order_by('date')
webpage_list = AccessRecodrd.objects.... |
b2380bb656e519d399a73f4d3e39ef49ac38cc12 | ff9886d722244d78b17208f9f943b036d0dcdd83 | /ruby/spec/codes/renderer.render_360.py | 68bdea8f1c21b91bf45a23e7aec00a0eac907da4 | [] | no_license | workon3d/tws_sdk | 27a73fbdc521dddc969836dcbd324d1ed0161e80 | b81dede39be5e487b03f3a13fed3fdb286926df2 | refs/heads/master | 2021-06-03T17:17:37.784627 | 2018-07-13T05:05:42 | 2018-07-13T05:05:42 | 16,397,470 | 0 | 4 | null | null | null | null | UTF-8 | Python | false | false | 541 | py | renderer.render_360.py | import renderer
import json
filename = os.environ['TEST_MODEL_PATH'] + '/simple/Cylinder.stl'
material = renderer.make_material('default_material', diffuse_color=renderer.rgb(132, 132, 132))
scene = renderer.SceneOptions(default_material=material)
scene.samples = 4
scene.use_shadow = True
scene.transparent_backgroun... |
d350e2400cf517e15c0f65687f76b7f6b19fd54d | ad17a4efbde41b2ee485c3b4402841736861e1fe | /nodeMCU_code/change_before_to_after.py | c043d59d5588f53bcbe0e4fbf6cf9bd8da6ad4b5 | [] | no_license | taeugi323/Capstone | 516f716be95ad811bcffc2ad3db667e57d4a93d2 | 0caf717f5096933a8a0044e2ca20ebd909ffc749 | refs/heads/master | 2020-04-02T04:42:30.804241 | 2016-06-08T18:09:51 | 2016-06-08T18:09:51 | 60,714,271 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 369 | py | change_before_to_after.py | def change_from_original(filename):
fp1 = open(filename,"r")
fp2 = open("after_"+filename,"w")
fp2.write("file.open(\"imp.lua\",'w')\n")
for i in fp1.read().split("\r\n"):
fp2.write("file.writeline([["+i+"]])\n")
fp2.write("file.close()")
fp1.close()
fp2.close()
change_from_orig... |
bf5bf001de4c301ff69a58485d0751c289da5f6a | 28b19848020eacd802cd326a00339e0bff53a954 | /run.py | 363817b5280e617545b73c2ddc7afde5a1161222 | [
"Apache-2.0"
] | permissive | a523/obscmdbench | c5c744407034fff3ff44ebf2c4e3c304b83296de | 109f83d42f7e266d6205bac3f13c210502ed86f4 | refs/heads/master | 2021-09-26T12:47:37.601331 | 2021-09-26T06:04:44 | 2021-09-26T06:04:44 | 287,210,750 | 0 | 0 | Apache-2.0 | 2020-08-13T07:26:08 | 2020-08-13T07:26:08 | null | UTF-8 | Python | false | false | 231,845 | py | run.py | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import sys
import os
import time
import math
import random
import commands
import logging
import logging.config
import datetime
import hashlib
import base64
import multiprocessing
import results
import Util
import obsPyCmd
import myLib.cloghandler
from StringIO import Strin... |
6c4f082f7068ad145090bec6b30e25f58ed092d8 | f49ce7268c612e2499cd1d108365ccaf85cb4aa0 | /mnm/instances/migrations/0005_auto_20170501_1719.py | 5be9b58cbda7fce11b934567d9796988fced319b | [
"MIT"
] | permissive | svoeth/mnm | 5de8a357fc4772e75df8139a7f632952d3580e00 | adf45c5f86611851ef3f51b60c30150095dba638 | refs/heads/master | 2022-01-07T02:12:08.572091 | 2018-09-14T16:26:33 | 2018-09-14T16:26:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 849 | py | 0005_auto_20170501_1719.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-05-01 17:19
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('releases', '0002_auto_20170501... |
2e95b0e7bc99c68913fc88ce0e2661c7deb0f8b9 | 883c475191edd39c1a36a0873fd2f460a07dbb59 | /test_autocti/extract/one_d/conftest.py | 0d83febb48d058e1c986bbf92a6cde0b4cce9562 | [
"MIT"
] | permissive | Jammy2211/PyAutoCTI | c18f4bb373572be202d691cc6b1438211a2cd07b | 32e9ec7194776e5f60329e674942bc19f8626b04 | refs/heads/main | 2023-08-16T10:59:09.723401 | 2023-08-14T09:42:57 | 2023-08-14T09:42:57 | 156,396,410 | 6 | 2 | MIT | 2023-09-03T20:03:43 | 2018-11-06T14:30:28 | Python | UTF-8 | Python | false | false | 306 | py | conftest.py | import pytest
import autocti as ac
@pytest.fixture(name="masked_array")
def make_masked_array(array):
mask = ac.Mask1D(
mask=[False, False, True, False, False, True, False, False, True, True],
pixel_scales=1.0,
)
return ac.Array1D(values=array.native, mask=mask)
|
6ae1565a84622eefbe95b14aba57fa8dddb1eb14 | c0fe1dd02dc90207901864c8db1169da79b2b574 | /ewah/operators/sharepoint.py | 3e21d23278e3d8dd83186dbea50e5a94106b6e17 | [
"MIT"
] | permissive | Gemma-Analytics/ewah | 413e7a771b4b788046453b3fa1d6f8efc602f17e | 1f31721cb93842bdad7caeb3e92fd5087f41821a | refs/heads/master | 2023-09-01T18:35:00.120481 | 2023-08-17T11:48:20 | 2023-08-17T11:48:20 | 215,871,905 | 24 | 4 | MIT | 2023-08-17T11:48:22 | 2019-10-17T19:38:23 | Python | UTF-8 | Python | false | false | 1,200 | py | sharepoint.py | from ewah.operators.base import EWAHBaseOperator
from ewah.constants import EWAHConstants as EC
from ewah.hooks.sharepoint import EWAHSharepointHook
class EWAHSharepointOperator(EWAHBaseOperator):
_NAMES = ["sharepoint"]
_ACCEPTED_EXTRACT_STRATEGIES = {
EC.ES_FULL_REFRESH: True,
EC.ES_INCREM... |
827594b9e6625177e2574358b42db2cecfda3f2b | 592a279f868ebe8c0fbdffc1136461c85e818cad | /python/celery_user/proj/celery.py | 7eac4f9687fa24eb95d3d4920583e9eecf31f174 | [
"Unlicense"
] | permissive | seckcoder/lang-learn | ad0e849e7575a47bd5cd88d1ff4c56a4eec8ec65 | 1e0d6f412bbd7f89b1af00293fd907ddb3c1b571 | refs/heads/master | 2021-01-20T06:56:49.322037 | 2015-10-28T22:25:05 | 2015-10-28T22:25:05 | 13,863,341 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 327 | py | celery.py | from __future__ import absolute_import
from celery import Celery
celery = Celery('proj.celery',
#broker='redis://10.1.9.9:6379',
#backend='redis://10.1.9.9:6379',
#include=['proj.tasks']
)
from proj import celery_config
celery.config_from_object(celery_c... |
423eef5a7b2d85fc8f786e5803586a9e4ae8dee8 | 5508226dfb380ea4883c7470f66308bc1b87e4dd | /som_utils.py | b923b9ac55256520d56b38948f616f6d0c79cb0e | [
"MIT"
] | permissive | derkwilson/PhotSOM | a11ec29d041c34d28d95d7d8d40086b2374462ed | 1a018c32cfa908f346be938fff759f10cca62be0 | refs/heads/main | 2023-01-03T15:38:49.169826 | 2020-10-30T03:06:14 | 2020-10-30T03:06:14 | 126,242,397 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,258 | py | som_utils.py | import numpy as np
import pandas as pd
from astropy.io import fits
import wpca
from sklearn.decomposition import PCA
from scipy.optimize import curve_fit
def rms(data_list):
data_list = np.array(data_list)
return np.sqrt(sum(data_list ** 2) / len(data_list))
def compute_colorAB(f1, sig1, f2, sig2):
del... |
2a249a1f2e15b22e9ec648ed1faa2e01b2117203 | 448ae55a3822943467bad2c7a0c44f57b31bbde9 | /dicommodule/Patient_ROI.py | 471507148401e500413f4d50bcadb5a59b9699b8 | [] | no_license | marksemple/pyPatient | 33a7ecffeaefe9e15d6a9b99194925bee92702d9 | 5be8a11cedd8a710c60c24a01bf80a2a17d00d7d | refs/heads/master | 2020-03-17T18:46:27.671509 | 2018-12-03T22:11:13 | 2018-12-03T22:11:13 | 133,832,917 | 2 | 0 | null | null | null | null | UTF-8 | Python | false | false | 9,295 | py | Patient_ROI.py | """
ROI (Region Of Interest)
"""
# Built-In Modules
import os
# import sys
# Third-Party Modules
import numpy as np
import cv2
import uuid
try:
import dicom as dicom
except ImportError:
import pydicom as dicom
import pyqtgraph as pg
class Patient_ROI_Obj(object):
def __init__(self,
... |
938ca02cd74753471667bcd7ed6f71cbd66c5496 | abbafe78e99337b58257da3114ce8fe4c9a8306b | /web-scraping/main/scraping_website/__init__.py | d99190e5da4a8bd336974a1ae0fe7dd086aa6edc | [] | no_license | phatnguyen080401/Coin-Market-Analysis | 4ffba9471d08c2b891c0ffa047f3472b9259f33c | d643c58208f1143bbbfd3fefe88ab1fe682b81ea | refs/heads/master | 2023-09-06T10:19:50.894409 | 2021-11-17T06:15:32 | 2021-11-17T06:15:32 | 382,039,684 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 83 | py | __init__.py | from .navigate_website import NavigateWebsite
from .web_scraping import WebScraping |
cf4dd9d3ebfa82a59faf40a4492cc1aa6f37606e | 7348229e9509dfcb8a153a2ad57df6daee61227d | /django/blogproj/blog/blog_app/urls.py | d9ea219e2e290b968c7100ec34326aa2ba2af1ae | [] | no_license | tommymag/CodeGuild | 13615e9406e180fa05a4588f2b198884dcb4f65e | bcc3b9f7bbd51feb345306f3fa818ecefd8ce42b | refs/heads/master | 2021-01-21T12:12:34.653619 | 2018-10-05T20:40:55 | 2018-10-05T20:40:55 | 102,051,655 | 0 | 1 | null | 2018-07-25T21:44:23 | 2017-08-31T22:42:39 | Python | UTF-8 | Python | false | false | 342 | py | urls.py | from django.urls import path
from blog_app import views
app_name = 'blog_app' # for namespacing
urlpatterns = [
path('', views.index, name='index'),
path('profile', views.profile, name='profile'),
path('blog_create', views.blog_create, name='blog_create'),
path('blog/<slug:slug>', views.blog, name='bl... |
42f5b39e338495a7d2f545cd6c6b8293d5754ba9 | 9e8d58a12fc39a15c1d50c79341ebe92db0ad4e4 | /formsio_app/data_models/user/models.py | 23faa68cd0f1ca1891b76a937ac73fa6bd523d4e | [] | no_license | cristiandarla/formsio | a640fb7d2401398ae9bea8737ba802c13d36760a | df47b046fe9e29ac0047e290312cc306cff70272 | refs/heads/main | 2023-05-15T02:54:15.237597 | 2021-06-05T22:56:02 | 2021-06-05T22:56:02 | 342,834,576 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,790 | py | models.py | from flask import Flask, jsonify, request, session, redirect
from passlib.hash import pbkdf2_sha256
from formsio_app.app import db
import uuid, datetime
from random import choice, shuffle
icons = ['profile1.jpg', 'profile2.jpg', 'profile3.jpg','profile4.jpg', 'profile5.jpg', 'profile6.jpg']
class User:
... |
9b16260369bc317a33cfae0777239267b6f9a9d8 | 601f29b4839bd0bc385ac5a879d209ca7e9f07ae | /font2hand_exp/test.py | ba6785642a2b54b16f108b8139d4eeb6badf59c0 | [] | no_license | TanKinh/AugmentedCycleGAN-handwritting | ad26b5ea717249396ee3af63e61a8298960053e9 | 75ce1225828454ba2e4501fa8213a26ae7dcb08c | refs/heads/master | 2020-04-29T15:23:49.517866 | 2019-06-19T09:21:05 | 2019-06-19T09:21:05 | 176,226,616 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 17,340 | py | test.py | import os
import time
import numpy as np
import torch
from torch.autograd import Variable
import torchvision.utils as vutils
from options import TestOptions
from font2hand_data import DataLoader, load_font2hand, AlignedIterator, UnalignedIterator
from model import StochCycleGAN, AugmentedCycleGAN
import pickle as pkl
i... |
e27e5faead8aba97a3a121fd6ea38d9a45d05bdf | a8e18679292dedd17c3d537a86f706b25eb6caed | /python_script/unit_2/ssh_connect.py | 68b7d1cf66513c4b3b9db390f4d8a07574a6d4ed | [] | no_license | wucaishe/violent-python | 0886478bd5cc1b0dea036dbbaad693d28a25fae9 | 051be4fe8e6dbdc32cb3665510731bda3216fd20 | refs/heads/master | 2022-01-04T05:56:42.954477 | 2017-02-15T06:50:54 | 2017-02-15T06:50:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,207 | py | ssh_connect.py | #!/bin/env python3
# -*- coding: utf-8 -*-
# version: Python3.X
"""
2017.01.31 进行 ssh 连接, [PS] 自己试了书中的代码没法成功连接上, 所以就仅供参考了
"""
import pexpect
__author__ = '__L1n__w@tch'
PROMPT = ["# ", ">>> ", "> ", "\$ "]
def send_command(child, cmd):
child.sendline(cmd)
child.expect(PROMPT)
print(child.before)
def c... |
8a8a864189ac8c79889458cf242dc3ddc67c579d | 569e88b377cf8ce28e8eaf4e9de686a4d01f0811 | /tests.py | a6ea9c5182ac3172a76f9e371f22ac041a808361 | [] | no_license | rackeric/cloudmanifest | ef4893d13f84f7ac743da42daf652f30404004e1 | b8e4a829f225524313333775c2225ad6e3891254 | refs/heads/master | 2021-01-10T05:36:57.913077 | 2015-11-25T15:36:15 | 2015-11-25T15:36:15 | 45,722,523 | 2 | 0 | null | null | null | null | UTF-8 | Python | false | false | 11,662 | py | tests.py | import os
import manifest
import unittest
from manifest.tasks import convert_bash_colors
from manifest.tasks import sanitize_keys
from manifest.tasks import populate_playbooks
from manifest.tasks import run_ansible_jeneric
from manifest.tasks import run_ansible_playbook
from manifest.tasks import run_ansible_playbook_m... |
3835f3704315df27c486808ca84707dd31bd32ca | 7288b96c28332a1a29d258f0a6246df7e42cf503 | /task1.py | 1cfe09c3b233152de29eb65cd45451768e3af1bb | [] | no_license | ShukaiLiu/fizzbuzz | e62d4eae29170b76224db9c6b30b7e973eac1c5a | 7394d96510c5975e84fb73962781ce212fa83edd | refs/heads/master | 2020-05-26T12:12:36.716495 | 2019-05-23T14:48:49 | 2019-05-23T14:48:49 | 188,227,660 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 413 | py | task1.py | def replace():
myfile = open("","wt")
for line in myfile.readlines():
for word in line:
if word[-2:] == 'er':
word = word[:-2] + word[-2:].replace('er','xor')
print(word)
for i in word:
if i == 'o' or i == 'O':
i = '0'
elif i == 'a' or i == 'A':
i = '4'
elif i == 'e' or i == 'E':
... |
46f4a4a2d962f3b9962816712171ba0814e841e3 | efdca2e4c955be78f934a37588b4675b4e2d83f3 | /Source Code/ipGrabber.py | fd6ca90c7872601ba052198aefa329d0a63f7490 | [] | no_license | antgurevich/IP-Grabber | e0c9abf09b9ff7eedba217f215219ca20b8f2455 | 571d95dc9862a83960df7219134d94d9ff72da5c | refs/heads/main | 2023-01-05T00:45:43.487699 | 2020-10-27T21:40:22 | 2020-10-27T21:40:22 | 307,833,903 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 872 | py | ipGrabber.py | import socket
import tkinter as tk
###########################################################################
def ipGrabber(): #Reads host name & ip address
global hostName,IP
hostName=socket.gethostname()
IP=socket.gethostbyname(hostName)
results()
################################################... |
d4b07e69bc0984df3f7da2572eaa8895a9c273eb | 6d88f68465d313967fcfdcb768984a2b8031a643 | /apps/scraper/tasks.py | 61205c4c05a899ea42d544797fa5cdb89b5a6abe | [] | no_license | HosseyNJF/digicloud-challenge | 1853894463655a8a445f510b2b4ff59c003b307d | 7ce637c20f7b9cd0569dac19d34037948913f872 | refs/heads/master | 2023-07-12T08:59:34.040889 | 2021-08-16T03:25:04 | 2021-08-16T03:31:30 | 395,975,148 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 754 | py | tasks.py | from celery import shared_task
from django.conf import settings
from requests import RequestException
from apps.scraper.models import Feed
@shared_task
def update_feed(feed_pk):
feed = Feed.objects.filter(pk=feed_pk).select_related('periodic_task__interval').first()
_update_feed(feed)
def _update_feed(feed... |
970ed88e676362c193a89700242b626da31a31f9 | ee0b9cd2424e634a212a6d9734af1eaedd40dfe0 | /jhub37_mcstas_baseline/sasview-5.0.3/src/sas/sasgui/guiframe/local_perspectives/data_loader/load_thread.py | 59949155e31b43e91334a5a33caa27fbf73595cb | [
"BSD-3-Clause"
] | permissive | moving-northwards/Docker | 775755b4618c1a7946f540505b0178e119d294d1 | 8ef18fd8c6abb0608ce9b53187e53d00d3e4e9ae | refs/heads/master | 2023-05-26T08:42:58.634525 | 2021-06-15T08:41:08 | 2021-06-15T08:41:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,572 | py | load_thread.py | """
Loading thread
"""
import time
import sys
import os
from sas.sascalc.data_util.calcthread import CalcThread
EXTENSIONS = ['.svs', '.prv', '.inv', '.fitv']
class DataReader(CalcThread):
"""
Load a data given a filename
"""
def __init__(self, path, loader,
flag=True,
... |
aa77f6924704178116551b57feaa1faa36c8fba3 | 08c5a1b10b17aee67c9a96f36c07f8b7106653fe | /d33-iss_notifier/main.py | 1e2b85d1bcf99b7f0d0cafbdb8c01f8a16e77122 | [] | no_license | srmcnutt/100DaysOfCode | 2b6f003b871381edf42c71b2453a72ce903fb9dc | 3f33917741ece894c5537ef26bce7388a785c294 | refs/heads/main | 2023-03-05T00:55:43.971522 | 2021-02-16T11:40:39 | 2021-02-16T11:40:39 | 326,688,409 | 1 | 1 | null | 2021-01-14T16:27:52 | 2021-01-04T13:12:53 | Python | UTF-8 | Python | false | false | 1,210 | py | main.py | import requests
from datetime import datetime
MY_LAT = 26.261020 # Your latitude
MY_LONG = -80.084720 # Your longitude
UTC_OFFSET = -5
def is_iss_overhead():
response = requests.get(url="http://api.open-notify.org/iss-now.json")
response.raise_for_status()
data = response.json()
iss_latitude = float(... |
45dab02d8a083dd49deaf9909f9f9e42df21c63a | 97c9e512b13393879e899e9ba7813612f4991a55 | /1.py | 62d0d02ff50b9d89a59adced29df6a337de62914 | [] | no_license | wangye349/python-cookbook | c9eac8dc455d985d38bf69f8cf5b7ab74bcf1ff8 | 7a79920c69f3be70fd9f103c2308ed86dca6c37e | refs/heads/master | 2020-06-14T17:50:49.416314 | 2019-07-03T15:08:57 | 2019-07-03T15:08:57 | 195,077,879 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,179 | py | 1.py | # though _ is meaningless, the string's length needs to be larger than the variables
a, b, c, d, e, _ = 'hello '
pass
def drop_first_last(grades):
first, *middle, last = grades
return sum(middle) / len(middle)
def search_tail(items):
head, *tail = items
return len(tail) if head else tail
items_te... |
c8b57d071de19253507a22d9af2dea9efbce72a0 | 5be916e4a6e36a204b7a05bfb673fd56e7369010 | /Python/src/2020-21/20201028_while_05.py | 6bf918868b42a170ff784db280b2c70ee2f7d6b2 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | hichamkettani6/computer-sciences | ccd27c058f65a0b79950d7d92b64ddbb9ce6d384 | 07c59e4269eae3efbf4f771c36a67e7b1ea09a57 | refs/heads/master | 2023-08-16T05:14:51.383989 | 2021-10-22T12:43:47 | 2021-10-22T12:43:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 738 | py | 20201028_while_05.py | # ###### /=================================================\
# ####### | CLASS EXAMPLE FOR "COMPUTER SCIENCES" (07JCJ**) |
# #### \ | https://github.com/squillero/computer-sciences |
# ###G c\ | |
# ## _\ | © 2020 Giovanni Squi... |
7f4502c2ff609c2625b536663c5123f46c5971f4 | 9b59f15eb46973de57d5d9c573884a12fb44b5e7 | /Ex1/EXE1_b150115cs_rajeev_4.py | ab5520acad1b4560c0bcd822168e9ce7db55bb1d | [] | no_license | rajeevrmenon97/iplab | 0462643ac7dd0d8f700c17161dd67d71d88a9e08 | 6c4a1d2471cdfa47d9b11eaf31814542b818ad2e | refs/heads/master | 2020-04-19T17:31:03.209599 | 2019-03-20T06:48:21 | 2019-03-20T06:48:21 | 168,337,244 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 835 | py | EXE1_b150115cs_rajeev_4.py | from PIL import Image
import math
img = Image.new("L",(64,64))
for i in range(64):
for j in range(64):
pix = int(round(abs(math.cos(math.sqrt(i*i + j*j))) * 255))
img.putpixel((i,j),pix)
out_img = Image.new(img.mode,(img.size[0],img.size[1]))
for i in range(img.size[0]):
for j... |
f50c96e85f1b33210be8c0a49dca1ba0ad5f156f | 181d5c03717e851d1ba22faaf64bba9d8d899401 | /Codes/a6.1.py | f23237d5dd80c8c2dfd610355fee087862ad06be | [] | no_license | arjunjc93/assignment-6 | 19a8bbfbe0d62969a5b7ba60218ffa224ff8d958 | 085b948e5e040e4c2cd8ac30e6b24280706fcb06 | refs/heads/main | 2023-08-02T10:49:30.564175 | 2021-09-16T04:21:59 | 2021-09-16T04:21:59 | 405,298,681 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,200 | py | a6.1.py | # -*- coding: utf-8 -*-
"""a6.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1ut1Ski_GGXUat6IQfGHrHzpJ2brCuYam
"""
import numpy as np
import matplotlib.pyplot as plt
from numpy import linalg as LA
O = np.array(([-1,0])) # found from eq
f = 0 ... |
75957b475701d27db2365faf25913e1b8a7b529d | 3abc1fef99ac6ce0b845a1090fae7f6875fee729 | /src/ralph/ssl_certificates/__init__.py | eb89e7ddb6ce5458188152403d328c7d1ff4e0b0 | [
"Apache-2.0"
] | permissive | allegro/ralph | 5ff9165a202e836061c99e8af20214e0d651622f | b4a72356f527b1f12c7babd7465d2d7fa3ffb0d3 | refs/heads/ng | 2023-09-02T01:13:43.672554 | 2023-09-01T09:48:38 | 2023-09-01T09:48:38 | 4,359,038 | 1,970 | 617 | Apache-2.0 | 2023-09-01T09:44:39 | 2012-05-17T14:04:57 | Python | UTF-8 | Python | false | false | 67 | py | __init__.py | default_app_config = 'ralph.ssl_certificates.apps.SSLCertificates'
|
851a6e255ccb2744a638a84e37cd65d3849b3ef4 | 4d688cb090f7d0dedf3bdac153f18ade6e202e8a | /bin/PennSeq.py | bcbaef9a7ea7d5709583f8eb1e5310311ba55413 | [] | no_license | huyustats/PennDiff | 84dde0ff141ea2f3cb9961a6ddc228eb743ad8cf | 4b24f7a731b739da99b84d90b91aa647c8aa52a1 | refs/heads/master | 2023-02-03T01:33:50.760409 | 2020-12-20T22:24:01 | 2020-12-20T22:24:01 | 72,712,597 | 1 | 2 | null | null | null | null | UTF-8 | Python | false | false | 27,314 | py | PennSeq.py | #!/usr/bin/python
from __future__ import print_function # load print function in python3
from collections import defaultdict
import math, sys, os, re, pysam, time
# set up auto dictionary function
def auto_dict():
return defaultdict(auto_dict)
####################################################################... |
745e7fcc71bebcc82b85e9606c7a59be991a0560 | 9135a1c5bcd20f77971085496d9e966d892fb7e9 | /oracle/python/updateOracleLogDeletion/updateOracleLogDeletion.py | de9c2dd7d039ebfcd9144cf5dd6ae44bda92e631 | [
"Apache-2.0"
] | permissive | bseltz-cohesity/scripts | cc54b2b3534175562b0d9cfba85bd63aa5ca2346 | 53c4b057bb4f41ae079fc8236caacf13fd35c10e | refs/heads/master | 2023-08-23T13:13:12.169724 | 2023-08-22T13:21:22 | 2023-08-22T13:21:22 | 142,414,700 | 83 | 44 | Apache-2.0 | 2023-08-24T11:42:22 | 2018-07-26T08:50:47 | PowerShell | UTF-8 | Python | false | false | 5,035 | py | updateOracleLogDeletion.py | #!/usr/bin/env python
"""unprotect oracle"""
# import pyhesity wrapper module
from pyhesity import *
# command line arguments
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('-v', '--vip', type=str, default='helios.cohesity.com')
parser.add_argument('-u', '--username', type=str, default='helios... |
b39a65eb03e17727b6285add733d3d17ca7c4820 | 60658a52e876c3fe4787ff7b9f7fb1a3dfd88555 | /String/string.py | ee3d74b4e8464ceda8aa94b1652bc45028bb2ca0 | [] | no_license | Michael07220823/Tools | 2666bf05dbaa90ead28e10f4b1edfadb319bf0fc | 6beff4a3dc125cabf8e09f41349ccd1267c16187 | refs/heads/master | 2021-06-26T02:23:22.476920 | 2021-05-08T14:29:20 | 2021-05-08T14:29:20 | 222,844,687 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 75 | py | string.py | compare_string = lambda input_text, compare_text:input_text == compare_text |
0e61167de20987838c2881322a218c46fa79c532 | 31bbb93f70be6fe3d4fe5be9cf6416709fa02eed | /pre_expire_bugs.py | 3b031e2d27327c9c5bcefadf22169acab123ddff | [
"Apache-2.0"
] | permissive | pombredanne/release-tools | 34e95111d31ad8478be15fa79fcbf6114fc333cb | 15ec2e7e4c71f131ef58e2dd6a3ae2064ee3fdbe | refs/heads/master | 2021-01-18T07:46:08.042020 | 2016-06-22T14:53:07 | 2016-06-22T15:47:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,671 | py | pre_expire_bugs.py | #!/usr/bin/env python
#
# Script to prepare bugs with no activity for expiration
#
# Copyright (c) 2015 Thales Services SAS
# 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... |
ae85e33413f02621d3104d5c5b7d74c46bac38df | b2ff53d368f543b4234a5c3a699d4dc51dc2ae00 | /python_intro/07_01.py | bc516bf19dfe1b93bcb195ce3d7806ec404afb52 | [] | no_license | KostivAndrii/sources | 9710c1123aa628f758ee31bd29d0779db168d58b | 263a7455abee59c05566977af603fb14a86aa98f | refs/heads/master | 2022-12-21T14:19:40.341327 | 2019-08-07T11:59:58 | 2019-08-07T11:59:58 | 181,833,282 | 4 | 2 | null | 2022-12-16T22:58:33 | 2019-04-17T06:47:38 | Java | UTF-8 | Python | false | false | 3,474 | py | 07_01.py | #### concurent.futures
import urllib.request
import shutil
import argparse
import os
from html.parser import HTMLParser
number_of_starttags = 0
number_of_endtags = 0
rezults_tag = []
# create a subclass and override the handler methods
class MyHTMLParser(HTMLParser):
def handle_starttag(self, tag, at... |
614755de007c34d2901846ba6efc9f2417a215d2 | 0f7e95ba42ced063130069061bbbebf803885c42 | /POSets.py | 568a5e01897ccdbcfb421f96f4508252b7c0d49f | [] | no_license | JorikSchellekens/POSets | f23667854ccf3c69f8fa9acf130343d8c77a841a | 038efe858dda380ae880c19d943408eeb1a127d9 | refs/heads/master | 2021-01-02T23:08:32.661279 | 2017-08-06T09:35:46 | 2017-08-06T09:35:46 | 99,473,237 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,335 | py | POSets.py | class POSet(object):
def __init__(self, node=None):
self.relations = frozenset()
self.elements = set()
if node is not None:
self.relations = frozenset([(node, node)])
self.elements.add(node)
def series(self, poset):
new_poset = POSet()
# Union of... |
4789f040041e310115b2664fdaa8294a9ed71cd4 | 0c7c9382398f06484af369c21ae842d34c0ead5b | /Qt_QML/create_object_name_for_ids/createObjectNames.py | 41878dbd438ca02c66e9930ae5ebfae1c5e4101c | [] | no_license | sitting-duck/stuff | e14ba3d274a2818ae48e0f00b68fec3b9f820154 | 077cfe5dc9c040b30d8f9ced2c46eeb2eb5d6eef | refs/heads/master | 2023-01-19T23:21:25.006210 | 2023-01-05T03:49:24 | 2023-01-05T03:49:24 | 31,349,892 | 53 | 22 | null | 2020-07-18T01:33:56 | 2015-02-26T04:01:34 | Shell | UTF-8 | Python | false | false | 3,263 | py | createObjectNames.py |
import argparse
def main(fileOutputFlag, fileUrl):
"""
:return:
"""
# grab the command line args
args = parseCommandLineArgs()
# open the file
inputFile = open(args.fileUrl, 'r+')
# grab the lines from the file and put them in a list
lines = inputFile.readlines()
#for line i... |
8697afb72e66587955cf643a1ad2a2a6c9bb0d80 | 5854ae09b7f6b118666404eb31952041e4e6a77b | /python笔记/aaa基础内置/python内置模块/hashlib-模块(加密)/SHA512-demo.py | b3eb0b0dc916a5d1c5aa5de3b35526c6ab813799 | [] | no_license | asihacker/python3_bookmark | 41fcfd3a7cfd1eeee92332745a9402cf9f912fc6 | 49d4988593616e74502481631c6021953aca8c3b | refs/heads/master | 2023-06-23T22:21:46.846703 | 2021-07-29T01:35:17 | 2021-07-29T01:35:17 | 247,292,548 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 403 | py | SHA512-demo.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2021/5/28 12:43
# @Author : AsiHacker
# @File : SHA512-Process启动子进程.py
# @Software: PyCharm
# @notice : True masters always have the heart of an apprentice.
import hashlib
hash6 = hashlib.sha512() # 不同算法,hashlib很多加密算法
hash6.update(bytes('password', encod... |
59c7a9f54f76559d4ec3dd3f51d8a4ed741a083c | 93c50982c5aa550e3b60f6fdcdf1a73bbd5e95cc | /vstdlib_random.py | 013c29a892ade3d2bbd53d5544f530f3162daf06 | [] | no_license | sebastian-nawrot/csgo-recoil-dumper | e959ed9d6da12fe9f047b193901d4b2e9b762aad | da60e48e5d48201e297bf2d2d3bdc2961aa5ae18 | refs/heads/main | 2023-06-20T02:15:31.308167 | 2021-07-16T19:12:04 | 2021-07-16T19:12:04 | 386,740,132 | 3 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,535 | py | vstdlib_random.py | import numpy as np
NTAB = 32
IA = 16807
IM = 2147483647
IQ = 127773
IR = 2836
NDIV = np.float32(1+(IM-1)/NTAB)
AM = np.float32(1.0/IM)
EPS = np.float32(1.2e-7)
RNMX = np.float32(1.0-EPS)
# Source SDK public\vstdlib\random.h
class UniformRandomStream:
def __init__(self, seed: np.int32 = np.int32()):
self.iv ... |
f8c62263995ff6d07bd08a646f45dcae77b6670d | f896aef28bcb3935d04f299ddbe13883afae6ffe | /winterSeason.py | a2ea46e1ecb07692a82d5fa114c91b772166dd28 | [] | no_license | kas-matK/the_Sandlot | 18e251554ab6dabea123ff610fd26b03ad580a22 | 675081017c830d7fbf44434bcbc9784d119b8fb9 | refs/heads/master | 2021-01-05T08:59:13.920133 | 2017-08-28T18:28:03 | 2017-08-28T18:28:03 | 99,515,312 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,156 | py | winterSeason.py | # Problem 1
# LOOP WAY
# def threeAndFive(myNum):
# runTot = 0
# for i in range(1,myNum):
# if (i%3==0) or (i%5==0):
# runTot += i
# else:
# runTot += 0
# return runTot
# RECURSION WAY
# DO NOT USE a myNum ABOVE 999
# def threeAndFive(myNum):
# myNum -= 1
# i... |
a0cdfe902a9e8bc79819202f5bcd3d82e3a909bf | c93ab1961bbe6206908acd8ca3e6a30dbb3a2764 | /PublicTools/PacketTools/tmp/Packet/GC_MOVE_PAK.py | 3605f963a84cce7d5d2f9f99a7dc3eaf8aa41e47 | [] | no_license | zhangdongai/XiuXiu | dbce9f6b76182e99b6a1ef9dac885cb76cfb3f2e | 632c02c502c8419e3c7c2fdea0482ceeed2ddc86 | refs/heads/master | 2020-03-20T14:36:08.889923 | 2018-06-15T13:57:46 | 2018-06-15T13:57:46 | 137,490,119 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 532 | py | GC_MOVE_PAK.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
from Common.NetWork.Packet.PacketDefine import *
from Common.NetWork.Packet.PBMessage_pb2 import *
class GC_MOVE_PAK:
def __init__(self):
self.PacketData = GC_MOVE()
def GetPacketId(self):
return PACKET_GC_MOVE
def GetPacketSize(self):
re... |
cdbdadd39130b36b16e653ebce4fd47fba290e37 | 0f4a8a70208b21ff2f8de4e0d14587e501e310dc | /scripts/gui/launcher.py | 54ffaae7c40d0ea714ed9d77306a449dc01743ee | [] | no_license | jotix16/ROS_Noisifier | 75316a35910cccada3e1aa4232f4a9d03efa4255 | 252d2f3054d5dd9515ea31cd0392a28c0a775d4d | refs/heads/master | 2023-01-31T20:35:46.045517 | 2020-12-11T14:24:04 | 2020-12-11T14:24:04 | 309,440,408 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 4,452 | py | launcher.py | import rospy
import os
import rospy
import rospkg
import subprocess
import roslaunch
import rosbag
from threading import Thread
from std_srvs.srv import Trigger, TriggerResponse
def start_roscore():
p = subprocess.Popen("roscore", stdin=subprocess.PIPE, stdout=subprocess.PIPE, shell=True)
state = p.poll()
... |
f6ade008ea5284680dc040e245331d764f3852c2 | 242086b8c6a39cbc7af3bd7f2fd9b78a66567024 | /python/PP4E-Examples-1.4/changes/book-web-site/snapshot-oct11/lentimer.py | 0caa0bda7e7a1d196786d254141e30c2ad1819cb | [] | no_license | chuzui/algorithm | 7537d0aa051ac4cbe9f6a7ca9a3037204803a650 | c3006b24c4896c1242d3ceab43ace995c94f10c8 | refs/heads/master | 2021-01-10T13:05:30.902020 | 2015-09-27T14:39:02 | 2015-09-27T14:39:02 | 8,404,397 | 4 | 4 | null | null | null | null | UTF-8 | Python | false | false | 979 | py | lentimer.py | "test the relative speeds of len(X) versus X.__len__()"
import time, sys
def timer(func, reps=50):
"""
time the best of N runs of a zero-arg function;
see also generalized timer() in the book LP4E,
pages 509..518, in Chapter 20, Functions part
"""
best = 2 ** 32
for i in range(reps):
... |
5979eb0d5a540b2ff330a748df28092474cf5f27 | 25c90ffdd2688e255b548d823763821f56c85a1f | /listening_test_summer_2020/analysis/data_processing/preprocess_extra_data.py | 2ad75aad5cb3be7343ffa47f5a634cd47fceb3a8 | [
"Apache-2.0"
] | permissive | google-research/korvapuusti | ec6688fd569ffaaae4550d815d972370e6a44d73 | f96fc565ed77c9fe298bd5d06e06329818f73b0c | refs/heads/master | 2023-08-06T21:34:25.814399 | 2021-06-07T09:08:09 | 2021-06-07T09:08:09 | 285,788,133 | 7 | 5 | null | null | null | null | UTF-8 | Python | false | false | 5,705 | py | preprocess_extra_data.py | # Copyright 2020 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# https://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing,... |
91b42a1f2a319a10b9ca23dd3dd228bc3e796809 | c95c35c44e7d1dca791ed0aa8031e1e2014448d0 | /monte_carlo/test_monte_carlo.py | 5084d714022c5e6bf7bcec481d1c9808c5be880f | [
"MIT"
] | permissive | vbalogh-ultinous/reinforcement_learning-stormmax | d3fc320780e813bc3e9da4329afcc3c8f52f237f | 8eeb0ff2f62d650161e158359bbffe7070602d5a | refs/heads/master | 2020-12-08T16:22:29.841936 | 2020-02-24T13:33:20 | 2020-02-24T13:33:20 | 233,032,245 | 0 | 0 | MIT | 2020-01-10T11:22:58 | 2020-01-10T11:22:57 | null | UTF-8 | Python | false | false | 1,478 | py | test_monte_carlo.py | import unittest
import sys
if "../" not in sys.path:
sys.path.append("../")
from envs import gridworld
import monte_carlo
class MonteCarloAgentTest(unittest.TestCase):
"""
Unit test for monte carlo agent
"""
def test2(self):
print 'Test 2 -- Gridworld test'
grid = [['0', '0', '0', '1'],
... |
45dc8830f242f81f074e88081d7155a368afa14f | 3f07f1f1cb7914b9de618522cd95ccbcd2c8d906 | /swap.py | c597f88a2085127fc3f829bd9bdf55b04cd991af | [] | no_license | hbaderman/algorithms | c32b882f7b54eac9ac5570c666afa7ed150d5d66 | 65f661c052cee1b6f54b06de1b44245d264a9750 | refs/heads/master | 2020-12-31T06:32:35.706849 | 2016-05-15T16:34:34 | 2016-05-15T16:34:34 | 58,864,382 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 330 | py | swap.py | # implement swap
arr = [4,9,7,10,4,3,5,129,23]
def findSmallest(arr):
smallest = arr[0]
for i in range(0,len(arr)):
if ( arr[i] < smallest):
smallest = arr[i]
return smallest
def selectionSort(arr):
smallest = findSmallest(arr)
secondSmallest = secondSmallest(arr,smallest)
_sorted = selectionSort(arr)
prin... |
09dcc23214e3f3fdf0480426434952731f1e2bad | d342469067092e3c0aba380282b64db2f854fae9 | /server/accounts/migrations/0003_auto_20170320_0353.py | 6c099ac3f8a3307079b08a1fa60c7c16c3a41b91 | [] | no_license | LeeKevin/stockphotos | 47826ffaa223322de85a69ca7a440c15e9058549 | d4a0da88a45a6d430e3a8cb00fa8ccbbde4d90e6 | refs/heads/master | 2021-01-10T16:49:56.300183 | 2017-10-09T18:59:05 | 2017-10-09T18:59:05 | 47,740,689 | 3 | 1 | null | null | null | null | UTF-8 | Python | false | false | 5,142 | py | 0003_auto_20170320_0353.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-03-20 03:53
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import utils.models
class Migration(migrations.Migration):
dependencies = [
('accoun... |
c7df044f294d02739ba3b35a59223247e25a8d91 | 2af3d618db0acf5ccf487920c37015a21a2a7b48 | /nc_files/python/M107 | a23b6014cb235df28763df91c8e535c379eee0c6 | [] | no_license | peterdownunder/LinuxCNC-3D-Printing | c1ad39a14c54005d00cccf55bd5c7581920ba899 | aa0d336465370b549ad6bdf0f3179e55972d3fdf | refs/heads/master | 2023-06-20T23:51:51.400910 | 2021-07-28T21:59:13 | 2021-07-28T21:59:13 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 590 | M107 | #!/usr/bin/env python2
# Note! Change the above "python2" to "python" is not using Arch Linux
# M code to set Fan speed
# M107 in your G code program will run the python code in this file,
# passing the P and Q variables as command line arguments.
import sys
import hal
Mcode = 'M107'
usage = 'Fan off'
pin = 'SP'
S... | |
1d0f3db58dd3c5aee23407ae4e8568280299ad80 | f4af33b9a46effbd6cbcd84eedbc8992d3f3a5ce | /unit3/api.py | e0f18319ce35faffdb41ac7ab1cc371e4bf30b62 | [] | no_license | ajdt/udacity_cs212 | d7fac354e8cc4ee54674cf40baf605f47f758bbf | bc9225ba7e04b7d219fed387a045dfec09c9bbcf | refs/heads/master | 2020-11-30T01:44:36.911165 | 2016-09-17T17:22:27 | 2016-09-17T17:22:27 | 68,466,208 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,436 | py | api.py | #---------------
# User Instructions
#
# Fill out the API by completing the entries for alt,
# star, plus, and eol.
def lit(string): return ('lit', string)
def seq(x, y): return ('seq', x, y)
def alt(x, y): return ('alt', x, y)
def star(x): return ('star', x)
def plus(x): return seq(x, star(x))
def o... |
045d8df6b3b1005e882c0afa66eec0311ae21820 | ed3fb286b2dbd2697c373f5dded0c09f1b38462c | /Python 2-7/OBI/1042-Sort Simples.py | ff1c7f4a0711b9735b7a4ce27e1f1077d0e9b24a | [] | no_license | Fernando-EngComputacao/Extensions | 7108b50978e0c3e2db0f73b918513a8e630cf1e0 | 763aa9776acca643baec6b6f06928d32292eb621 | refs/heads/main | 2023-08-06T15:24:54.832436 | 2021-10-09T12:35:06 | 2021-10-09T12:35:06 | 415,286,678 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 372 | py | 1042-Sort Simples.py | # -*- coding: utf-8 -*-
a,b,c = raw_input().split()
a = int(a)
b = int(b)
c = int(c)
ac = a
bc = a
cc = a
if b > a and b > c:
cc = b
elif c > a and c > b:
cc = c
if b < a and b < c:
ac = b
elif c < a and c < b:
ac = c
if b != ac and b != cc:
bc = b
elif c != ac and c != cc:
bc = c
print ac... |
505462fc6e9c807f6f8aa8d46e9cc82bca09b75f | 19e7daa126f9ed964f8252ff406e5de78b3736cf | /DiscordBot/cogs/Processes/spell_gather.py | fd4bcf0ac20784d802bdffe836d4cda9377dda62 | [] | no_license | Craiga214/D-Dbot | bcb1060baea1bb0306136740d3976c7131cc4119 | 2a4002c4339c95ef05b0c10e65745a678c88a543 | refs/heads/master | 2023-01-04T02:41:51.789652 | 2020-11-01T19:56:55 | 2020-11-01T19:56:55 | 309,173,950 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 801 | py | spell_gather.py | def spellGather():
#Grabbing all text from csv file
file = open('.\\cogs\\Processes\\spell_storage\\spell_list.csv', 'r')
file = file.read().split('\n')
#Creating hashmap to hold spells with names as keys
spellDict = dict()
catNames = file[0].split('&')
#There are 484 spells in the game... |
69b3568e77841d2710aa3510dd1b7a21498808f3 | 7545a426a26f65d9ee905be9ff6f239a7d2e127f | /HeapArray.py | 151bd0672e721ebbbdede11fc496724af577be0c | [] | no_license | aalbert-dev/Brandeis-Map-Tour-Guide | 073a5347091e9e7a85f69018d0633a326d613050 | db891873b9d4cf36443428a7397eb9b47a5d8b2a | refs/heads/master | 2022-04-16T00:41:56.227324 | 2020-04-08T18:52:44 | 2020-04-08T18:52:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,328 | py | HeapArray.py | # @author Arjun Albert
# @email arjunalbert@brandeis.edu
# class to use for a min heap array data structure
class MinHeapArray:
def __init__(self):
self.heapArray = []
self.nextElementIndex = 0
# insert element (vertex, priority) into heap
def insert(self, element):
if i... |
0d2a78ea02a51238c38a1a245e02ff35b78ebabf | d0af99fd59b2536a07bcfe36a1f060ce64f433e5 | /blog/admin.py | 6c1cd8c8ad8f8458d612e30157ef72c2be457fa1 | [] | no_license | COSOLIG-UIGV/cosolig-herokuapp- | f5bacb24d96937c8c1c7b5898273d76f1e1f3df7 | e3e3be2f754e0c500bf9088a18da458801c899a2 | refs/heads/master | 2021-01-22T03:05:23.371624 | 2015-08-15T08:58:52 | 2015-08-15T08:58:52 | 39,641,590 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 809 | py | admin.py | from django.contrib import admin
from blog.models import Post,Miembros
#admin.site.register(Post)
@admin.register(Post)
class Administrador(admin.ModelAdmin):
list_display=('titulo','evento_activo','capacidad')
list_editable = ('titulo','capacidad','evento_activo')
actions = ['guardado']
def guarda... |
56da60951468d11d220dec105595faf534f3cc82 | 82d804028b11f7c985d5e1add154dee91ff34657 | /prmlpy/plot/ch2_p70_sequential_learning.py | 2769ee2150b3fedb04ff34b85b48d2434a794c85 | [] | no_license | laysakura/prml-python | 9d559e916eb0c8f5937cc10ab421b9cb91b87afe | cd0cb4e472b49d519d297588a28e42313240e4b2 | refs/heads/master | 2021-01-10T20:46:38.776021 | 2015-08-09T14:50:42 | 2015-08-09T14:50:42 | 40,040,150 | 4 | 0 | null | 2015-08-08T15:19:21 | 2015-08-01T08:14:43 | Python | UTF-8 | Python | false | false | 2,639 | py | ch2_p70_sequential_learning.py | """
prmlpy.plot.ch2_p70_sequential_learning
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:synopsis: 二項分布の逐次学習。
「表」が出る真の確率(学習される対象) μ を REAL_MU として、この確率に従って、歪んだコインをD回トスする。
事後分布 p(μ|D) は、事前分布 p(μ) と尤度関数 p(D|μ) の積に比例する。
p(D|μ) が (2.9) の二項分布で与えられるので、 p(μ) は共役性を持ったベータ分布を仮定する。
そうすると、 p(μ|D) は (2.18)... |
54f8f2ab6b7ec58d90bb646a8a629ecb3ab2ec4c | a85466c4f7c68557dc488965de9417f39cdcfe67 | /app.py | faeed2af0947e1dc44b80984ed91ab3a7bda3f13 | [
"MIT"
] | permissive | gregoiredelzongle/nvidia-bot | 0eec388e2f04f281ceefb1e18cc7dc227a67a9bf | 935da02d5a575cb426eb770597631e0edd42517e | refs/heads/master | 2023-02-10T22:31:25.606675 | 2020-09-20T20:55:00 | 2020-09-20T20:55:00 | 297,117,800 | 1 | 0 | MIT | 2020-09-20T16:32:59 | 2020-09-20T16:32:58 | null | UTF-8 | Python | false | false | 6,523 | py | app.py | import json
from concurrent.futures import ThreadPoolExecutor
from guizero import App, PushButton, Box, TextBox, Text, Combo
from cli import cli
from stores.amazon import Amazon
from stores.nvidia import GPU_DISPLAY_NAMES
from stores.nvidia import NvidiaBuyer
from utils.logger import log
class MainUI:
def __ini... |
4e8ebb93adf25f33de09d815b614cac9cd518ae4 | b22848ed288a9a6b8bb51b65b480730402d7cb14 | /schedule/serializer.py | f47408ab520dda4c1e24b5d0f6f0a24da30d88c1 | [] | no_license | ChisengaSol/sfats | 7a4cef839f5089f7c9df9dcf1a499be993551aa7 | b6ef59d0c672d044795a68346b15061806bb79e0 | refs/heads/master | 2022-06-24T19:26:38.216651 | 2020-02-24T14:15:08 | 2020-02-24T14:15:08 | 240,530,280 | 0 | 0 | null | 2022-05-25T02:58:27 | 2020-02-14T14:46:35 | Python | UTF-8 | Python | false | false | 305 | py | serializer.py | from rest_framework import serializers
from .models import Schedule
from users.serializer import UserSerializer
class ScheduleSerializer(serializers.ModelSerializer):
class Meta:
model = Schedule
fields = '__all__'
user_details = UserSerializer(source='stafalty', read_only=True) |
12096acfff05a441531749469415b527492a5496 | 0cba5529e387ba0f077b4e8ddeb96f914004f5df | /malaya/pos.py | 3d41be1e4a6a2d49394a028c8c28931d4f264620 | [
"MIT"
] | permissive | AsyrafAzlan/Malaya | dc78398ee6880578f40c5646a48882a5913217ae | 3d5166173cf74881f7a56fffaaf391813c55d4f1 | refs/heads/master | 2021-05-21T22:47:41.863857 | 2020-04-03T15:00:21 | 2020-04-03T15:00:21 | 252,841,526 | 1 | 0 | MIT | 2020-04-03T21:04:44 | 2020-04-03T21:04:44 | null | UTF-8 | Python | false | false | 2,566 | py | pos.py | import re
from malaya.text.tatabahasa import tatabahasa_dict, hujung, permulaan
from malaya.supervised import tag
from malaya.path import PATH_POS, S3_PATH_POS
from herpetologist import check_type
_availability = {
'bert': ['base', 'small'],
'xlnet': ['base'],
'albert': ['base'],
}
def available_transfor... |
56dcb1a3dd259bb4bd28e937bb47655686b7c27b | d1288cd07210b7e509b1cd96953d2e4d3b2a0cd9 | /text_files/auto_segmentation.py | 199a13ad9d4064f75024c08de915bf5190027c45 | [] | no_license | aubreystevens/image_processing_pipeline | 3ea678f8f02c8c0590aad8abe239a9174c74e56e | 8e9c8b3b1cf33ae0e24524a080b614777bebf1e0 | refs/heads/master | 2023-01-01T07:13:50.016979 | 2020-10-15T04:04:26 | 2020-10-15T04:04:26 | 299,176,876 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 17,029 | py | auto_segmentation.py | import numpy as np
import numba
import pandas
import skimage
import skimage.io
import skimage.filters
import skimage.segmentation
import skimage.measure
import skimage.morphology
import skimage.feature
import bi1x
import imageio
import os
import colorcet
import bokeh.io
import bokeh.plotting
import bokeh.palettes ... |
a284e76a4e5e0f7732830c7ee4205cf7e1c46eff | 3d5a669f0878a4594893e5136849faa0915aea71 | /src/expe_scripts/invert/expe_ten_gtzan_spectral.py | 518ab801196dc95d64d9834db29ad5146c1c0060 | [] | no_license | mmoussallam/audio-sketch | 6829449a8c6fd0d303a9f813664c32b8d286801f | 486bc79ca3b4039f3b00665a67cf451f3d6ca367 | refs/heads/master | 2018-10-31T17:55:18.091308 | 2014-05-01T22:56:10 | 2014-05-01T22:56:10 | 7,933,802 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 4,524 | py | expe_ten_gtzan_spectral.py | '''
expe_scripts.invert.expe_ten_gtzan_spectral - Created on May 7, 2013
Synthesis by taking the median of various magnitude spectrograms
@author: M. Moussallam
'''
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from PyMP import Signal
import sys
import os
from feat_invert import reg... |
5e315ccc5a916fd70a4fcd47c226af5d368be3d0 | a979fcec5f81bb71c0096ad4d55db380e0d8c714 | /MAD/bin/dust.py | d5258224bfae3f6add4bf23bc4efa8a7959c5dbe | [] | no_license | dbdbdb156/MAD | c5b9a13937b0015dd5e5d7271bd430be2f8bc677 | 8b5e97c61a837eb2fcb6266fa4c7f04ea42bfa7e | refs/heads/master | 2021-07-10T03:19:32.832538 | 2019-06-17T10:54:09 | 2019-06-17T10:54:09 | 186,617,467 | 0 | 2 | null | 2020-09-04T09:20:27 | 2019-05-14T12:29:15 | JavaScript | UTF-8 | Python | false | false | 561 | py | dust.py | import serial
from PMS7003 import PMS7003
dust = PMS7003()
# Baud Rate
Speed = 9600
# UART / USB Serial
USB0 = '/dev/ttyUSB0'
UART = '/dev/ttyAMA0'
# USE PORT
SERIAL_PORT = USB0
#serial setting
ser = serial.Serial(SERIAL_PORT, Speed, timeout = 1)
buffer = ser.read(1024)
if(dust.protocol_chk(buffer)):
data = ... |
295eaec4cd337506b22e25dd774cbca2e49d517c | 841c0df958129bef4ec456630203992a143c7dc7 | /src/2/2408.py | 520da9741d43457fe77b55db4039b380fa77b5a6 | [
"MIT"
] | permissive | xCrypt0r/Baekjoon | da404d3e2385c3278a1acd33ae175c2c1eb82e5e | 7d858d557dbbde6603fe4e8af2891c2b0e1940c0 | refs/heads/master | 2022-12-25T18:36:35.344896 | 2021-11-22T20:01:41 | 2021-11-22T20:01:41 | 287,291,199 | 16 | 25 | MIT | 2022-12-13T05:03:49 | 2020-08-13T13:42:32 | C++ | UTF-8 | Python | false | false | 367 | py | 2408.py | """
2408. 큰 수 계산
작성자: xCrypt0r
언어: Python 3
사용 메모리: 29,200 KB
소요 시간: 68 ms
해결 날짜: 2021년 10월 19일
"""
def main():
formula = ''
N = int(input())
for _ in range(N * 2 - 1):
formula += input()
formula = formula.replace('/', '//')
print(eval(formula))
if __name__ == '__main__':
main() |
a7bfc03c507cd631d704e858877db6cd7cf6cbec | f1cfa56a231d64f8ffa74182b2b1e3280255c128 | /Tucil 1 - Kripto/Other/autokeyvigenere.py | d32924b3a67d70c747256e3f03045b2c10cc7e6a | [] | no_license | AlfandaviAU/KriptoWithTanur | 02bb24b48e2699b7cd93332e2f3dd3f749de9200 | ae75428d791548c5eaa89be90a13a41f9686ffe8 | refs/heads/main | 2023-07-25T20:11:34.514319 | 2021-09-04T15:54:55 | 2021-09-04T15:54:55 | 401,679,125 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,432 | py | autokeyvigenere.py | from basicOps import *
plaintext = cleanInput("negarapenghasilminyak")
input_key = cleanInput("indo")
print(plaintext)
print(input_key)
def encryptAutoVigenere(text,key):
arr_text = convertPlainToArr(text)
arr_key = convertPlainToArr(generateAutoKey(text,key))
arr_hasil = []
for i in range (len(text)... |
d4f9b11d207c344fc8dfb14bff24718478944caf | ef178dff600603be7c8b22774c5d586ab54c45f2 | /clients/migrations/0004_auto_20200914_1108.py | 646bcd2f09e9ae1b30a943b3d99d55e0518721a6 | [] | no_license | snavelycoreyt/assignment1-deployment | 14042b42b397e6d29665312e99f6f3d4c45f8bbb | f9f96cbe6a565d66b96ca0a12c326b847a9bdeb1 | refs/heads/master | 2022-12-24T18:35:35.148565 | 2020-09-16T18:37:09 | 2020-09-16T18:37:09 | 295,791,005 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 508 | py | 0004_auto_20200914_1108.py | # Generated by Django 3.0 on 2020-09-14 16:08
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('clients', '0003_auto_20200914_1105'),
]
operations = [
migrations.RenameField(
model_name='client',
old_name='dateofpurchase',... |
c0a8a7d25eb9a54ce036310a5d4df9084ef452c2 | 27345773167abfdfa26822dd16226a38c995c36a | /my_py_script.py | ea85de5f9c7db28fd63b2671dfa4fc84d2bd89b9 | [] | no_license | drdzl/ML | bb06c9578d6c7d9e25c958018ba6d64b9d54f9ae | 11eeb3a728508e37fb0121661396cb9f9202a3a9 | refs/heads/master | 2023-03-05T11:28:11.945756 | 2021-02-20T17:24:42 | 2021-02-20T17:24:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 7,403 | py | my_py_script.py | import sys
import tensorflow as tf
print("tf.__version__: %s" % str(tf.__version__))
import os
import deepchem as dc
print("dc.__version__: %s" % str(dc.__version__))
from deepchem.utils.save import load_from_disk
import pandas as pd
print(pd)
from rdkit import Chem
from rdkit.Chem import Draw
from rdkit.Chem import Pa... |
b16f8db622029b28a75135a4a641c92ab66354bf | 1a93cf692b7acb3a9b5d6d64e89fb11132f7258e | /App/Controller/scorecards_controller.py | f77fdc9c6487939baf83d6bb34bfc04c8078de6f | [] | no_license | AndreasGustafsson88/Webbramverk_discgolf | acfabad8969ad9f9d7c35a5c7896e8d45e37a169 | ebc7241fc9668584d0ae2c3b393e344c038ac170 | refs/heads/master | 2023-03-02T06:01:05.210071 | 2021-02-12T10:35:27 | 2021-02-12T10:35:27 | 321,637,918 | 0 | 0 | null | 2021-02-13T08:04:09 | 2020-12-15T10:50:18 | Python | UTF-8 | Python | false | false | 971 | py | scorecards_controller.py | from App.Data.Repository import scorecards_repo as sr
def get_scorecard(**kwargs):
return sr.get_scorecard(kwargs)
def delete_scorecard(scorecard):
sr.delete_scorecard(scorecard)
def create_scorecard(course, players, multi, rated):
round_summary = {'course_id': str(course._id),
'... |
f06bb997e78b99fd6af2977a6070c40cde2e668e | 4da7611f46249cd06c43fcd2ec8b77e0ce33fb13 | /wrtnode/mcu.py | 8b8c72cc1a9ccd6977b8e3f59e30ccf6fe501c00 | [
"MIT"
] | permissive | pumanzor/iot-redlibre | c2dda0468bfaa79155d972c55ec20064a5a05f4a | eee859d0ae5d40dd44942a5d46aa49cb60e8678a | refs/heads/master | 2021-01-22T03:06:26.417635 | 2016-12-26T19:50:25 | 2016-12-26T19:50:25 | 36,413,752 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,576 | py | mcu.py | import paho.mqtt.client as mqtt
import json, time
import mraa
led = mraa.Gpio(2)
led.dir(mraa.DIR_OUT)
# ----- CHANGE THESE FOR YOUR SETUP -----
MQTT_HOST = "190.97.168.236"
MQTT_PORT = 1883
# ---------------------------------------
# The callback function for when the client connects to broker
def on_connect(clien... |
997e6c86af5a58c27115fa614fdc95c7fbcd285e | 59aed92059824381f34e1585e9600878d91cadb0 | /supervised_learning/0x11-attention/7-transformer_encoder_block.py | 95b5bfad1580bedbede93cee1bb4edcb8daa8723 | [] | no_license | jdarangop/holbertonschool-machine_learning | 3509eaa6d191f6887be9bbbb5a1df565b0b51cc8 | 75274394adb52d740f6cd4000cc00bbde44b9b72 | refs/heads/master | 2021-05-17T04:51:44.675655 | 2020-12-02T02:52:31 | 2020-12-02T02:52:31 | 250,633,089 | 2 | 1 | null | null | null | null | UTF-8 | Python | false | false | 1,903 | py | 7-transformer_encoder_block.py | #!/usr/bin/env python3
""" Transformer Encoder Block """
import tensorflow as tf
MultiHeadAttention = __import__('6-multihead_attention').MultiHeadAttention
class EncoderBlock(tf.keras.layers.Layer):
""" EncoderBlock class """
def __init__(self, dm, h, hidden, drop_rate=0.1):
""" Initializer.
... |
6cc983b7c672c74c21100b6b7d6df3fa7be21a0e | 3982e6daf88e453c726f6b39a081fc37ce15a08a | /discovery-provider/src/tasks/index_challenges.py | f8968b0c03bee5ccc8262c830c7e3ec32f2c88ee | [
"Apache-2.0"
] | permissive | AudiusProject/audius-protocol | 45808e11082608ad5b76a425d287cb6d94a6dab0 | 7cf1d8e378520460d24a7cc8c29e9927c0944cb3 | refs/heads/main | 2023-08-09T10:34:28.850436 | 2023-08-09T04:28:17 | 2023-08-09T04:28:17 | 201,821,771 | 531 | 108 | NOASSERTION | 2023-09-14T21:27:52 | 2019-08-11T22:31:43 | TypeScript | UTF-8 | Python | false | false | 1,333 | py | index_challenges.py | import logging
import time
from src.tasks.celery_app import celery
from src.utils.prometheus_metric import save_duration_metric
from src.utils.redis_constants import challenges_last_processed_event_redis_key
logger = logging.getLogger(__name__)
index_challenges_last_event_key = ""
def index_challenges(event_bus, db... |
4399b8b70b7c0ef10a2a03006cf78b849441059d | 9c2edc273db48dcb6d31a937510476b7c0b0cc61 | /tutorial/c-api/memory/gc1.py | bfa9223066ec15e9345f872953ff094b3301a943 | [] | no_license | miyamotok0105/python_sample | 4d397ac8a3a723c0789c4c3e568f3319dd754501 | 77101c981bf4f725acd20c9f4c4891b29fbaea61 | refs/heads/master | 2022-12-19T22:53:44.949782 | 2020-05-05T05:09:22 | 2020-05-05T05:09:22 | 81,720,469 | 1 | 0 | null | 2022-11-22T02:22:55 | 2017-02-12T11:15:08 | Jupyter Notebook | UTF-8 | Python | false | false | 886 | py | gc1.py | import gc
import resource
import ctypes
def mem():
print('Memory usage : % 2.2f MB' % round(
resource.getrusage(resource.RUSAGE_SELF).ru_maxrss/1024.0/1024.0,1)
)
# We are using ctypes to access our unreachable objects by memory address.
class PyObject(ctypes.Structure):
_fields_ = [("refcn... |
ea4ed7f12491b1236587cbc449de8aa3d7d416f8 | 3f28aa7d9b1461665f1417f08fed111680af9874 | /learnGUI/pyqt5_example/Chapter04/qt04_QFontDialog.py | 1615468a900b74d6aed8aba069ca10eac6465c99 | [] | no_license | chen-huai/work | 3481751ce1f955f092531bb3e18203dc4d0c7ec8 | 3134a75a216213d3fbf1b3f2fd4a88e82367a10d | refs/heads/master | 2023-08-03T17:12:41.594007 | 2023-07-24T07:18:50 | 2023-07-24T07:18:50 | 200,787,315 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,670 | py | qt04_QFontDialog.py | # -*- coding: utf-8 -*-
'''
【简介】
PyQt5中 QFontDialog 例子
'''
import sys
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
class FontDialogDemo(QWidget):
def __init__(self, parent=None):
super(FontDialogDemo, self).__init__(parent)
layout = QVBoxLayout()... |
cf6ced3fe53d4e3f302ceb66b8dea15408ecc1df | 8bbfc5c81a89e60d29f47f0504de1cdcb82649f0 | /test/test.py | 16bef9c9ffa81b8c152359fc84c4a0f8758f6202 | [
"MIT"
] | permissive | nvictus/hic2cool | 2577392f9fe39e0b1cc43397381912d099883ddf | a88c40fb867f28fcfc8fc28f7d2b36ecfa490dad | refs/heads/master | 2020-12-02T07:42:50.822117 | 2017-09-05T22:37:33 | 2017-09-05T22:37:33 | 96,715,746 | 0 | 0 | null | 2017-07-09T22:45:21 | 2017-07-09T22:45:21 | null | UTF-8 | Python | false | false | 6,495 | py | test.py | #!/usr/bin/env python
# Test code for hic2cool
# Requires pip installation of cooler to run
# Must be run from this directory (/hic2cool/test/)
from __future__ import absolute_import, print_function
import unittest
# will only work with pip installed package
from hic2cool import hic2cool_convert, __version__
import co... |
721ff79f05c8a77ce9a724b21160dfe82b257747 | 44cf2388093a635731d6ead13e6e4198da62d70f | /fastapiapp.py | abedc975a2576425a37d052ecd2bb0f03dc66dca | [] | no_license | dhruvbpatel/Multiclass-Text-Classification | e8bf8c6330217f94a68d56a47fd98a96b10dba4b | 0a6d9634585f06b72143b4cda4a5c3e963a9fde1 | refs/heads/master | 2023-01-19T14:54:12.248851 | 2020-12-05T19:49:12 | 2020-12-05T19:49:12 | 289,444,704 | 1 | 0 | null | 2020-11-14T14:37:57 | 2020-08-22T07:50:35 | Jupyter Notebook | UTF-8 | Python | false | false | 1,699 | py | fastapiapp.py | import streamlit as st
import pandas as pd
from sklearn.metrics import classification_report
import findspark
findspark.init()
import sparknlp
spark = sparknlp.start()
import pyspark
from pyspark.ml import Pipeline
from sparknlp.annotator import *
from sparknlp.common import *
from sparknlp.base import *
from p... |
7f304167efb36294481e05f8126f3472f8cb51a5 | 2f72d89c0720743f075d496e7f84ace254cee322 | /scciclient/irmc/elcm.py | 5e1ad1dbbfbb2d07cea8727eaa5a86ed7057da70 | [
"Apache-2.0"
] | permissive | NaohiroTamura/python-scciclient | 7e2f29995fa9183635d01d398bffffed5d5ab2c7 | 77cfae4b91d2ffd484781dd9962cdede7a11d90c | refs/heads/master | 2021-01-17T01:24:34.520276 | 2017-04-24T05:34:18 | 2017-04-24T04:38:15 | 29,911,167 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 23,468 | py | elcm.py | # Copyright 2016 FUJITSU LIMITED
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... |
79f62a7ee6eb1f0d6df192c475af8fec47ca39a9 | ea5af064f6583c4dc244627f67bf51a9119347a9 | /crypto.py | 4c6a27ad97768b78070c68886cdd9f351d4f73f8 | [] | no_license | celiyan/PyPassManager | 034c10cfe594d365822dc836e0f0143e02ac25e3 | fda994b44b7a003825e16bbcaffd07cf094e04b7 | refs/heads/master | 2022-12-19T19:51:29.714559 | 2020-10-15T05:16:37 | 2020-10-15T05:16:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,530 | py | crypto.py | from Crypto.Cipher import AES
from os import urandom
def pad(txt):
"AES CBC requires the number of plaintext bytes to be a multiple of 16, so we pad it to the nearest multiple. Takes&Returns bytes object."
padding_length = AES.block_size - len(txt)%AES.block_size
# we pad with a character = to the padding length... |
53d9ef0b000bbe8054df21d1cae1e732d390fd45 | 3a4330fc5777ecab3bcefa51ca1ddf95e9ead508 | /modules/position.py | 8e0e0a91c3e3cdfaa53528a4cd00509621fc624a | [] | no_license | Jayllyz/SurvivetheTempest | eaaf3ab074653e2aa60f7ab189d3a5a61f5f12f0 | d6a79beb4df06f1616036c7b82d0ba9850a40c3a | refs/heads/master | 2021-10-10T10:43:30.741729 | 2021-09-28T16:36:08 | 2021-09-28T16:36:08 | 214,816,352 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 442 | py | position.py | #coding:utf-8
"""
Pour alléger le code
"""
from modules.texte import print_text
def action_pos(position_parcours, a_verifier, message, aliasing , couleur1 , couleur2, position , font , ecran, centre_x, centre_y):
if position_parcours == a_verifier:
print_text(message,aliasing, couleur2,position,font... |
cb58f5e2eeec42902028e7da151386e919a6283f | 165e706d485e90f4e4f63cfb9f2c35acda14cfc0 | /saccader/utils.py | 93984ab8c6b3c40b754b356020e619f9a3a28510 | [
"Apache-2.0"
] | permissive | Tarkiyah/googleResearch | 65581f3bbbe2ffe248c9e613c0ea7eac336d5372 | dea327aa9e7ef7f7bca5a6c225dbdca1077a06e9 | refs/heads/master | 2022-12-07T12:04:44.153221 | 2019-11-21T16:03:48 | 2019-11-21T16:18:28 | 223,229,888 | 11 | 2 | Apache-2.0 | 2022-11-21T21:39:10 | 2019-11-21T17:38:31 | Jupyter Notebook | UTF-8 | Python | false | false | 24,355 | py | utils.py | # coding=utf-8
# Copyright 2019 The Google Research Authors.
#
# 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 applicab... |
562742be942786a8be843f7448e00febf472004f | 0ced91e2aa082a25c4beff18fa863c4abea11646 | /blog/models.py | 07834fd7f9277a78506a6564b968a8f54d7dbc42 | [] | no_license | shumkar-barpiev/blogwebsite | 91ede0dc122c405baeb46b3e35979237deec39df | 65f59fc41ad602f6791cf1a09fd5e47f071d5090 | refs/heads/main | 2023-04-19T01:34:57.247648 | 2021-05-05T22:24:31 | 2021-05-05T22:24:31 | 364,720,544 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,056 | py | models.py | from django.utils import timezone
from django.db import models
from django.contrib.auth.models import User
from django.urls import reverse
class Category(models.Model):
name = models.CharField(null=True, max_length=150, db_index=True)
slug = models.SlugField(null=True, unique=True)
class Meta:
orde... |
93c03ab486981edbb2fbc99ed064b174a3bb5ac1 | ac2bf27611fbbad62f08f68e9984c708018db0f7 | /tosh/ui/scroll_window.py | 6975c323d4f846fca5633103e00806b13c44c1b6 | [
"BSD-3-Clause"
] | permissive | javitonino/tosh | 6b065de09d52a4ebc9d9762b8f43ca4fc5a59922 | e096ee435264849ab644c6b27d643352446d2b2a | refs/heads/master | 2021-07-05T11:13:55.570979 | 2017-09-24T18:56:41 | 2017-09-24T18:56:41 | 103,844,969 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,620 | py | scroll_window.py | from prompt_toolkit.layout.containers import Window
class ScrollWindow(Window):
'''
Hack for proper line scrolling of Window. By default, scroll is based in document lines (before wrapping),
so very long lines become problematic. This changes the behaviour to scrolling on lines after wrapping.
'''
... |
1572b0c24a11102eb7101981359666a448b30740 | a3f247d082b146e4355205952b2d80e95d105178 | /postprocessing/parsing_times.py | b9f2f5f442575935d63667be63459e63fa0abb4f | [] | no_license | nvarini/hpc_workflow | 82cd74fce41accd5932648a5de2465db0df287b4 | 120d95f4e2da4159031f53e307295573d264a8f4 | refs/heads/master | 2021-09-03T01:32:32.207694 | 2018-01-04T15:55:21 | 2018-01-04T15:55:21 | 109,979,058 | 1 | 2 | null | null | null | null | UTF-8 | Python | false | false | 8,360 | py | parsing_times.py |
import numpy as np
import matplotlib.pyplot as plt
import argparse
import colorsys
from collections import defaultdict,OrderedDict
from aiida.workflows.user.hpc_workflow.postprocessing.aux_routines import *
import sys
import operator
parser = argparse.ArgumentParser()
parser.add_argument("workflow_pk",type=int,nargs... |
0aac56d6223ff4509ce3935f5b2e1f823ce54ade | 66274cf0f857a4622f394ccf4ada48f22a88cb49 | /4c.py | ec3bce8955baecaac24243c73007a84d3804a986 | [] | no_license | nlpai-others/Sedong-Nam | c57e24fc07e52556c38352645ee0a8e231a79a77 | 9405bd3b28647b6ffec89d352ad306909456f94a | refs/heads/master | 2020-03-21T23:19:43.594607 | 2018-06-29T23:48:49 | 2018-06-29T23:48:49 | 139,180,468 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,040 | py | 4c.py | #!/usr/bin/python
import matplotlib.pyplot as plt
import sys
# trainings (x,y) pairs
trainings = [[1,2],[3,6],[7,14],[2,4],[4,8]]
trainings_X = [row[0] for row in trainings]
trainings_Y = [row[1] for row in trainings]
import random
import time
#가정 : y = ax + b
best_a = -1
best_b = -1
err_min = 1000
count ... |
4507fb95fcd12a874f4affad5c159f2409957c56 | 54e35d59cfe058d9b37d70e0acc89580d11ddb82 | /src/starkware/cairo/lang/compiler/instruction_test.py | 5bfd2a5456b03dedd2ad0c34a1f2a1dac9bdc40d | [
"Apache-2.0"
] | permissive | congge666/stark-perpetual | 5df4ea62fd329f36f0fa23a59935916dc4805ede | 9327c640e59bd15764833505560478d33aa6a8b1 | refs/heads/master | 2023-07-04T11:36:50.384423 | 2021-07-25T12:44:46 | 2021-07-25T12:44:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 645 | py | instruction_test.py | from random import randint
import pytest
from starkware.cairo.lang.compiler.instruction import (
N_FLAGS, OFFSET_BITS, decode_instruction_values)
def test_decode():
offsets = [randint(0, 2**OFFSET_BITS) for _ in range(3)]
flags = randint(0, 2**N_FLAGS)
instruction = 0
for part in [flags] + offse... |
4458de3115be7f3eee0c88816d41a930b3ca951f | 7d04565f3f78c73db81e62b51de6c547ac42c764 | /easyaudit/__init__.py | e8fd4de4f18b756bae2a3b887ab895238d92fadb | [
"MIT"
] | permissive | wilhsms/lifebox | f97bcc2d5b2f4bd429c815abe86545b5339edbb3 | d34e47596161aa2842bccefdd6c44d3d628c0b83 | refs/heads/master | 2021-08-28T15:14:13.723137 | 2017-12-12T15:07:22 | 2017-12-12T15:07:22 | 104,006,255 | 0 | 4 | MIT | 2017-12-12T13:18:14 | 2017-09-19T00:32:27 | JavaScript | UTF-8 | Python | false | false | 53 | py | __init__.py | default_app_config = 'easyaudit.apps.EasyAuditConfig' |
60cbcc3d5e094d7015660b6b86643441a7a188eb | c2b97f78d4aab1145798db7f1048ba9686ccfe24 | /oar_diffdvh_crsentropy_prediction_2d.py | 5e7b3c2164a64ee63df452371cb4b2663900c062 | [] | no_license | FrankZhangYK/DVH-prediction | 3e6c24a578a99498219e9834b75f778ce7aa42ff | 67cd95b15fddf033db301809e629b9fe535b797a | refs/heads/master | 2021-05-31T18:00:34.792197 | 2016-06-20T21:21:06 | 2016-06-20T21:21:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 9,604 | py | oar_diffdvh_crsentropy_prediction_2d.py | #OAR Diff-DVH prediction
#CNN with 3 CL, 2 FL and average pooling
#3 input channels corresponding to PTV, Rectum, and Bladder
#libraries
import numpy as np
import tensorflow as tf
import scipy.io as sio
import math
from matplotlib import pyplot as plt
import pickle
#data
file_Name = '/home/morteza/Dropbox/python_code... |
d48d1c8c17c32ee3ca2efdee39afb9228be6ffe4 | ad769bb8e7dd6fe1713abd14eda4b2787e393178 | /FLOW001_addnumber.py | 24a38e062056f5194256c3642b974e55544096b8 | [] | no_license | AkankshaRakeshJain/CodeChef | 41c1215feae578bf9081cec0fa28a5046b5a6300 | 7d810b431318318e08be884ae028099cb8689409 | refs/heads/master | 2022-09-21T15:29:48.281914 | 2020-06-04T18:09:32 | 2020-06-04T18:09:32 | 264,911,807 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 116 | py | FLOW001_addnumber.py | user = int(input())
for value in range(user):
first, second = map(int, input().split())
print(first+second)
|
bc0424a844f2fff8dfc33fcff91cdd9ec4e8f490 | 7e2e570c8419d4c49803d077556137e3e14f653c | /time_windows.py | e17a6f422ae26681bfce8380732d11417a386c05 | [] | no_license | kaittah/RouteOptimization | ad31ce5f995f9ef50d506f1415a99db739e92408 | db9f72715048d323befffba9c09ad5325ffffd1c | refs/heads/main | 2022-12-25T08:42:05.667492 | 2020-10-03T19:27:41 | 2020-10-03T19:27:41 | 300,429,126 | 2 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,850 | py | time_windows.py | from datetime import datetime, timezone, timedelta
est_tz = timezone(offset=timedelta(hours=-4))
delivery_times = {
'min': int(datetime(2020, 10, 1, 12, 0, tzinfo = est_tz).timestamp()),
'peak': int(datetime(2020, 10, 1, 12, 5, tzinfo = est_tz).timestamp()),
... |
7406f7a9d15d76909fd4869ade187fb9c7c3fbbe | 5207b5bc504bd4253da6e78a4e361db61c5b1e70 | /game/services/game/event/throwdice.py | 56453c86b7d3f9c7e94fc9927ae41aee3d14f890 | [] | no_license | luiz290788/ajani | 442853cc7c6865ae13cbbf7aee25dae9f798c3de | fdfa112893c4808508376ea308bfc7337169240a | refs/heads/master | 2021-01-01T20:34:47.968248 | 2015-06-14T20:54:49 | 2015-06-14T20:54:49 | 34,073,394 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 945 | py | throwdice.py | from services.game import dice
from services.game.state import OPENING_HAND
def _is_player_0(game, player_id):
return game.player_0 == player_id
def process(incoming_event, player_id, game):
player_0 = _is_player_0(game, player_id)
throw_dice = False
if player_0 and game.dice_player_0 is None or \
not ... |
b1319f13daf7431bbbbfc4d6d1c7a874c7758a9f | b3559840ed42f5b3d74fa77ebc44ee6e1b67652b | /test/test_state.py | e95b9e64dbbd2c87b80f4673c0083991a47bb7b8 | [
"MIT"
] | permissive | Tomos-Evans/statemachine | fef64b5c438f90091832f55e3233712297133930 | e88b05f60a2eeb9b6c3019de1baec0ca31375a54 | refs/heads/master | 2021-06-10T10:21:28.070632 | 2018-08-20T17:10:54 | 2018-08-20T17:10:54 | 145,208,641 | 2 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,010 | py | test_state.py | from statemachine import State
def test_string():
s = State('s')
assert str(s) == 's'
class TestHooks:
def test_empty(self):
s = State('s')
assert s.will_enter() == None
assert s.will_exit() == None
assert s.entered() == None
assert s.exited() == None
def sampl... |
413e9d71592aad46690dfe2f5212fc0088b599b2 | bd3af4238306e9991704624bee2db6aeb620e4f0 | /beanstalkc.py | 9a03b3db6c882bfac7019c5cb0a0bfb9c830f069 | [
"Apache-2.0"
] | permissive | PeterScott/beanstalkc | 31c0a1fd9f610f7031cbd3ae366d434e94c5865e | 8d648abae563c6daa3222cf58494c0b6c10cb2db | refs/heads/master | 2021-01-18T10:11:34.891526 | 2011-10-05T19:05:25 | 2011-10-05T19:05:25 | 1,276,851 | 2 | 0 | null | null | null | null | UTF-8 | Python | false | false | 14,508 | py | beanstalkc.py | #!/usr/bin/env python
"""beanstalkc - A beanstalkd Client Library for Python"""
__license__ = '''
Copyright (C) 2008-2010 Andreas Bolka
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://w... |
1b98bd73333daeca27c0ee15a73a6284f14a1db1 | f0bd47fae070c03a5f0e6bf2245d62a7c455645e | /feature_extraction/MPQA/parse_MPQA_feature.py | dde7229f05f6a5031922fc5e1092c359166fb7c7 | [
"MIT"
] | permissive | HKUST-NISL/OMG-Emotion-Challenge-2018 | 099bf108b37b23b378a723d4643e9e584b5afa40 | 78e7d9135b5f4ad83c06904c96043565a530de79 | refs/heads/master | 2020-09-25T21:37:36.108009 | 2020-07-13T04:29:50 | 2020-07-13T04:29:50 | 226,094,000 | 5 | 1 | null | null | null | null | UTF-8 | Python | false | false | 1,437 | py | parse_MPQA_feature.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 26 11:00:38 2018
@author: ddeng
"""
import pickle
import pdb
def read_file(file):
main_dict = {}
for line in file:
line = line.strip('\n')
line = line.strip('\t')
[vid, uttr, pos_uttr, neg_uttr, pos_vid, neg_vid,words... |
2f18bf9dcd36e61f10f01c4cb6d52d0a974628ff | 649704d1837f56fbbd944f2a95301ef6435ccce1 | /fpca.py | 6591b018184138a80c72c8fa16bef2c5183ecc81 | [] | no_license | dhhjx880713/fpca | 20a919f7237975c4c24421dca8c3cd5e88eae134 | eed089de21600b1a309ffd19d482594d14c899e8 | refs/heads/master | 2023-08-19T02:53:11.949769 | 2021-09-27T21:04:02 | 2021-09-27T21:04:02 | 410,868,303 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,797 | py | fpca.py | # encoding: UTF-8
import numpy as np
from sklearn.decomposition import PCA
from ...construction.fpca.functional_data import FunctionalData
from ...construction.utils import get_cubic_b_spline_knots
import copy
class FPCA(PCA):
'''
Bspline based functional Prinicipal Component Analysis
'''
def __init__... |
2691ade3591a76452f67b249ac9fd77e0421551d | e23a4f57ce5474d468258e5e63b9e23fb6011188 | /333_nuke/_templates/useful_small_function/nuke_utilz.py | ea6d00e7a7e399c689786be0e0c79006031901cf | [] | no_license | syurskyi/Python_Topics | 52851ecce000cb751a3b986408efe32f0b4c0835 | be331826b490b73f0a176e6abed86ef68ff2dd2b | refs/heads/master | 2023-06-08T19:29:16.214395 | 2023-05-29T17:09:11 | 2023-05-29T17:09:11 | 220,583,118 | 3 | 2 | null | 2023-02-16T03:08:10 | 2019-11-09T02:58:47 | Python | UTF-8 | Python | false | false | 11,277 | py | nuke_utilz.py |
################################################################################
### _____ Statments ###########################################################
_____ __
_____ re
_____ ?
_____ glob
____ comp_utilz _____ dbinfo
____ comp_utilz _____ decorators
########################################################... |
52acf77bc52a98f2486bb57d00586162691c417a | e547f7a92e7a1c1d79f8631f9e8ee8a93879a4eb | /src/transformer_classifier.py | 2037c9312c97e67af88b642a371573a980892ae4 | [] | no_license | gsakkas/seq2parse | 3c33ec7bc6cc6e4abd9e4981e53efdc173b7a7b9 | 7ae0681f1139cb873868727f035c1b7a369c3eb9 | refs/heads/main | 2023-04-09T12:29:37.902066 | 2023-01-18T21:32:12 | 2023-01-18T21:32:12 | 417,597,310 | 7 | 1 | null | null | null | null | UTF-8 | Python | false | false | 7,814 | py | transformer_classifier.py | import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
from tensorflow.keras import regularizers
"""
## Implement a Transformer block as a layer
"""
class TransformerBlock(layers.Layer):
def __init__(self, embed_dim, num_heads, ff_dim, rate=0.1):
super(TransformerBlock, se... |
eb02a8d62ccc73fc91666865f8e0f3db069bbf40 | 06579ca5babb1e271c45f8bd2303e47a6836dff9 | /prj3/userprofile/migrations/0003_auto_20210201_1433.py | 975487cd9615584ed8131353ae4c346d3ddce43a | [] | no_license | hungborung/exercise | feff41b02671f07d7ea0e30d2709951143551a8e | bb54fef58efd807034163cb3d729cdcab8bd8729 | refs/heads/main | 2023-02-27T15:30:38.720404 | 2021-02-04T10:57:54 | 2021-02-04T10:57:54 | 333,003,913 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 755 | py | 0003_auto_20210201_1433.py | # Generated by Django 3.1 on 2021-02-01 07:33
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('userprofile', '0002_auto_20210129_1617'),
]
operations = [
migrations.AddField(
model_name='user',
name='address',
... |
64f50398b5ac347175aa26442697abb96a84267c | c5e09a3cc3585095303856d570f6b69cc2e147a3 | /CliNER/code/feature_extraction/umls_dir/interpret_umls.py | 75271cb281f8643d7542eb62500695d00375d7e9 | [
"Apache-2.0"
] | permissive | asmitapoddar/Clinical-Named-Entity-Recognition-for-EHR | 5dc82eb282dc5f93ce9e7a20abdf5401fa636165 | a23dbda1491d326e7003ab468bfd70d99fcc5de3 | refs/heads/master | 2020-06-24T11:32:48.257927 | 2019-08-03T07:13:19 | 2019-08-03T07:13:19 | 198,952,112 | 3 | 0 | null | null | null | null | UTF-8 | Python | false | false | 11,710 | py | interpret_umls.py | import os
import sys
import cPickle as pickle
import interface_umls
import time
import nltk
metamap = None
def umls_semantic_type_word( umls_string_cache , sentence ):
# Already cached?
if False and umls_string_cache.has_key( sentence ):
mapping = umls_string_cache.get_map( sentence )
else:
... |